notification service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 08:50 AM
I want to get a notification in service portal, whenever the incident priority changes.
I have lost way to do it. Any help would be appreciated.
Thanks in Advance!
Somnath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 09:23 AM
You need to create Business Rules.
"When to run" section, select "After" from the "When" dropdown.
"Insert, Update, or Delete" section, select "Update".
"Table" dropdown, select "Incident".
"Filter Conditions" section, add a condition to check if the priority has changed. You can use the "changes" operator for this. For example, [Priority] [changes].
In the "Advanced" tab, write a script to send a notification.
(function executeRule(current, previous /*null when async*/) {
// Create a new GlideRecord for the sys_notifcation table
var gr = new GlideRecord('sys_notification');
// Set the event name
gr.event = 'incident.priority.change';
// Set the user to the current user
gr.user = gs.getUserID();
// Set the table to the incident table
gr.table = 'incident';
// Set the record to the current incident
gr.record = current.sys_id;
// Insert the new notification record
gr.insert();
})(current, previous);
You also need to create a notification for the 'incident.priority.change' event(System Policy > Notifications.).
Mark Helpful/Solution 🙂
Regards
Shaqeel
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 09:25 AM
Hi @Somnath_snow ,
Please refer below thread:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0684584
Create a notification on the incident table and add the above email script to the notification.
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 09:31 AM
Yes @Sumanth16 i have tried this.
But this won't work if i directly open Service portal. I think i have to create a widget in Service portal then add the notification.