how to send notification for all change task group after completing change request in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team
Please suggest configuration to send notification for all change task assignment group members after completing parent change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
57m ago
it's an easy requirement.
Simply have after update BR on CHG closure and use gs.eventQueue() to send email, recipients you can fetch from related change tasks associated to this CHG
I hope you are aware on how to use eventQueue(), BR and notification for this
💡 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
43m ago
Hi @vamshi2 ,
I tried your whole problem in my PDI and it works for me please check below solution
I Create a event - "send.notification.when.request.closed"
After that I created a Notification that triggered when event is called
Create a before BR and add below script
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
gs.log("BR Called");
var groups = [];
var users = [];
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.getUniqueValue());
gr.query();
while (gr.next()) {
groups.push(gr.assignment_group.toString());
}
var groupGr = new GlideRecord("sys_user_grmember");
groupGr.addEncodedQuery("nameIN" + groups);
groupGr.query();
while (groupGr.next()) {
gs.log("Inside while for users");
users.push(groupGr.user.toString());
}
gs.log("groups - " + groups);
gs.log("User - " + users);
gs.eventQueue("send.notification.when.request.closed", current, users.join(","), "");
})(current, previous);
Result:
Once I close this change_request it will send notification to all users of change task assignment group
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
