0

var requestType = g_form.getValue('requesttype');
 switch(requestType){
  case 'testcase' :
   g_form.setValue("type","testcase")
   break;
  case 'testcase1' :
   g_form.setValue("type","testcase1")
   break;
  case 'testcase2' :
   g_form.setValue("type","testcase2")
   break;
 }
}

How to use switch case in ServiceNow client script?
Working Code Asked question November 27, 2023