notification service portal

Somnath_snow
Tera Contributor

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

3 REPLIES 3

Shaqeel
Mega Sage

Hi @Somnath_snow 

 

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

Sumanth16
Kilo Patron

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

 

 

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.