Business Rule not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi,
I am trying to create a Business Rule for the incident matrix. Priority is not getting changed. Kindly help.
(function executeRule(current, previous /*null when async*/) {
var imp = current.u_impact.getValue();
var urg = current.u_urgency.getValue();
//var pri = current.u_priority;
gs.info('impact is ' + imp + ' urgency is ' + urg);
if((imp == '1') && (urg == '1')){
current.u_priority = '1';
}
else if((imp =='1') && (urg == '2')){
current.u_priority = '2';
}
else if((imp == '1') && (urg == '3')){
current.u_priority = '3';
}
else if((imp == '2') && (urg == '1')){
current.u_priority= '2';
}
else if((imp == '2') && (urg == '2')){
current.u_priority='3';
}
else if((imp == '2') && (urg == '3')){
current.u_priority='4';
}
else if((imp == '3') && (urg == '1')){
current.u_priority='3';
}
else if((imp == '3') && (urg == '2')){
current.u_priority = '4';
}
else if((imp == '3') && (urg == '3')){
current.u_priority = '5';
}
})(current, previous);
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
any reason you are using new u_priority field when there already exists an OOTB field?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader