How to change impact and urgency based on another field

Akshay Choudhar
Kilo Contributor

Hello so I need help with changing impact and urgency. I am auto populating three fields called category, application/device, and cause. find_real_file.png

each field is auto populated so application/device is populated based on category and cause is populated based on application/device. I am using this table to populate them find_real_file.png

 

also using script includes to do all that. Now what i have to do is have impact and urgency be populated based on cause field. I am stuck on how to do that. any help will be appreciated. 

5 REPLIES 5

dvp
Mega Sage
Mega Sage

 

Write a Before business rule on incident table and use the following script

Also make sure the condition is set to application device changes or category changes or cause changes

var gr = new GlideRecord("u_jda");
gr.addQuery("u_application_device", current.u_application_device); // update the field names
gr.addQuery("category", current.category);// update the field names
gr.addQuery("u_cause", current.u_cause);// update the field names
gr.query();
if (gr.next()) {
   current.impact = gr.u_impact;// update the field names
   current.urgency = gr.u_urgency;// update the field names
}

 

Note: left side field names (gr.FIELD_NAME) are on the JDA table where as current.FIELD_NAME is on incident table

siva_
Giga Guru

Based on dvp response , if you want to have them auto populated on insertion of a record and click save then you can follow what dvp said 

if you want to have the impact and urgency fields to be set as soon as you change the cause then you have to write an onchange client script on cause and call a client callable script include and then set the values of impact and urgency by gliding the records in jda table 

Hope that helps 

 

Mark this response as correct if that really helps 

 

Thanks,

Siva

 

Yes the onchange client script helped but i am now getting the error not an integer. here is my on change client script 

 

find_real_file.png

 

here is the error 

find_real_file.png

Here is the format for addOption method

g_form.addOption('priority', '6', '6 - Really Low'); // 3rd parameter should be label value