- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 01:22 PM
Hi everyone,
I created a business rule to update certain incoming tickets status to P2, but it doesn't work.
Appreciate any help on this. This is the code I use in the business rule:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 08:29 PM
Hi @RudyS
You cannot set the priority value directly, as it depends on the 'Urgency' and 'Impact' fields. Therefore, instead of updating the priority value, adjust the impact and urgency values as needed.
In OOB configuration, if Impact is 1 and Urgency is 2, or vice versa, the priority will be updated as 2-High.
(function executeRule(current, previous /*null when async*/ ) {
if (current.priority != 2) {
current.impact = 2;
current.urgency = 2;
}
})(current, previous);
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 08:53 PM
I agree with @J Siva
Just set the impact and urgency and the priority matrix will set the Priority and this is the OOTB platform behavior.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 08:29 PM
Hi @RudyS
You cannot set the priority value directly, as it depends on the 'Urgency' and 'Impact' fields. Therefore, instead of updating the priority value, adjust the impact and urgency values as needed.
In OOB configuration, if Impact is 1 and Urgency is 2, or vice versa, the priority will be updated as 2-High.
(function executeRule(current, previous /*null when async*/ ) {
if (current.priority != 2) {
current.impact = 2;
current.urgency = 2;
}
})(current, previous);
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 08:53 PM
I agree with @J Siva
Just set the impact and urgency and the priority matrix will set the Priority and this is the OOTB platform behavior.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 06:00 AM
Thank you Siva and Ankur.
Your solution worked. I'm not sure how I missed that 😊.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 06:22 AM
@RudyS Glad it helped