How to set Resolution Code default as 'Resolved' when State of Case changes to Resolved?

Daniel R2
Kilo Sage

I have a question around Resolution codes on a case and the client wants the below codes which I have configured on the choices dropdown below.

 

The client wants another option called ‘Resolved’ which is the default value and not part of a label. So i guess here in this situation, when the case state is ‘New’, ‘Open’ and ‘Awaiting Info’ the default value of the resolution code will stay as ‘--None--’, however when the case state changes to resolved, the Resolution code defaults to ‘Resolved’. How can i do this?

 

DanielRyszka_0-1668523989863.png

 

1 ACCEPTED SOLUTION

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Writedown onchange client script on case table as below :-

Script :-

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

   //Type appropriate comment here, and begin script below
	if(newValue=='6'){
		g_form.setValue('resolution_code','10');  // Replace your resolution code backend value in place of '10'. You will get that from configure dictionary - scroll down to choices
	}
   
}

GunjanKiratkar_0-1668524513591.png

 

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

View solution in original post

2 REPLIES 2

Mohith Devatte
Tera Sage
Tera Sage

hello @Daniel R2 ,

You can write n on change client script on the state field and you can set the value of the resolution code based on the state 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

  if(newValue=="your_reolved_choice_value")
	  {
		  g_form.setValue('your_resolution_code_field_name','resolved_state_choice_value');
	  }
   
}

 

Hope this helps 

Mark the answer correct if this helps you 

Thanks

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Writedown onchange client script on case table as below :-

Script :-

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

   //Type appropriate comment here, and begin script below
	if(newValue=='6'){
		g_form.setValue('resolution_code','10');  // Replace your resolution code backend value in place of '10'. You will get that from configure dictionary - scroll down to choices
	}
   
}

GunjanKiratkar_0-1668524513591.png

 

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy