I am trying to directly display within an alert message, the current incident's priority number only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 09:20 AM - edited 03-19-2025 09:41 AM
Hi ServiceNow SysAdmin Forum
I am trying to directly display within an alert message, the current incident's priority number only not the priority value such as 1 - Critical, 2 - High, etc., through a Business Rule without updating the Advanced option to " True ", without using script but directly by only using the Add Message option in Actions tab
=====
Incident with the priority of [ ${current.priority} ] has been created / updated
=====
Thanks
DPP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 09:24 AM
Hi ServiceNow SysAdmin Forum
I am trying to directly display within an alert message, the current incident's priority number only not the priority value such as 1 - Critical, 2 - High, etc., through a Business Rule without updating the Advanced option to " True ", without using script but directly by only using the Add Message option in Actions tab
When I use the add message text as below, the alert message shows the priority as its displayed value of 1 - Critical, 2 - High, etc., instead of 1, 2, etc.
=====
Incident with the priority of [ ${current.priority} ] has been created / updated
=====
Thanks
DPP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2025 03:33 PM
@DPP1 Can you share the code that you have tried till now, or some screenshots of the BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 10:02 AM
you can use after insert and update business rule and show that message
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if (current.operation() == 'insert')
gs.addInfoMessage("Incident with the priority of " + current.priority.getDisplayValue() + " has been created");
else if (current.operation() == 'update')
gs.addInfoMessage("Incident with the priority of " + current.priority.getDisplayValue() + " has been updated");
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 09:36 PM - edited 03-20-2025 03:23 AM
Hi Ankur
Thanks for your time to provide your update.
However, I was not looking for a script meaning then I would have to update the Advanced option to " True " to write it to be used, but instead I was looking to directly utilise / fetch the current incident priority numeric value i.e., 1, 2, etc., not its displayed value i.e., 1 - Critical, 2 - High, etc., within an alert message by updating the Add Message option to " True " under the Actions tab.
Thanks
DPP