Notify if an incident is high priority and unassigned for 2 hour when it is not assigned to any grou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi,
I tried, but the email is not triggering. I am using after business rule with insert update
(function executeRule(current, previous /*null when async*/) {
// Notify if an incident is high priority and unassigned for 2 hour when it is not assigned to any group
var gr = new GlideRecord('incident');
gr.addEncodedQuery('sys_created_onBETWEENjavascript:gs.beginningOfLast2Hours()@javascript:gs.endOfCurrentMinute()^assignment_groupISEMPTY^priority=1');
gr.query();
while(gr.next()){
gs.email('aileen.mottern@example.com', '', 'Aileen, assignment group is unassigned and the priority is 1', 'Aileen, assignment group is unassigned and the priority is 1');
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
It’s better to use the Flow Designer for this, where you can easily perform lookups and send emails to a person or group. As a best practice, all incidents from P1 to P4 must first be assigned to SD to take action
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
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
business rule requires a database operation to trigger.
better to use Flow for this, something like this and enhance further
OR
You can use inactivity monitor -> no scripting required
Get active with inactivity monitors
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Dr Atul G- LNG @Ankur Bawiskar,
I can use flow designer but i want to use business rule.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
you can do this even without scripting using Inactivity monitor or Flow designer.
Any reason you want to do using business rule only?
Many customers are moving towards no-code, low-code approach.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
