- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2020 02:29 AM
How to write a client script to calculate impact and urgency so that priority should auto populate
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2020 03:14 AM
Sample script as below.
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2020 02:33 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2020 03:04 AM
I am trying to display it on serviceportal via recordproducer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2020 03:13 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2020 03:19 AM
Can you please me with scripting part