The CreatorCon Call for Content is officially open! Get started here.

How to write a client script to calculate impact and urgency so that priority should autopopulate

Himabindu
Giga Contributor

How to write a client script to calculate impact and urgency so that priority should auto populate

1 ACCEPTED SOLUTION

Sample script as below.

find_real_file.png

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

	var getimpact=g_form.getValue('impact'); //replace impact  variable name
	alert('Impact user selected is '+getimpact); //Just for check can be commented
	
	var geturgency=g_form.getValue('urgency'); //replace urgency with variable name
	alert('Urgency user selected is '+geturgency); //for check can be commented
	
	if(getimpact=='high' && geturgency=='high')
		{
			g_form.setValue('priority','high'); //replace priority with variable name & set the value as high
		}
	
	
   //Type appropriate comment here, and begin script below
   
}

 

Note: You need to create 2 one for impact & other for urgency & replace variables & values accordingly.

View solution in original post

9 REPLIES 9

Jaspal Singh
Mega Patron
Mega Patron

Hi Himabindu,

 

Instead of Client script why don't you try for Data lookup Definitions. Type Data Lookup definitions in Application navigator for check.

Something that is used for setting Priority for incident on basis of Impact & Urgency.

I am trying to display it on serviceportal via recordproducer

Thanks for the clarification. In that case you need onChange() client scripts for both Impact & Urgency felds with all possible combinations so that Priority shows up correctly.

Can you please me with scripting part