sending notification to old assignment group manager when assignment group is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2024 11:49 AM
I have a requirement that when i have changed the assignment group of a incident a notification will be triggered to the manager of the oldValue of the assignment group which is getting change.notification will be like "incident num is already assigned to another group .so you donot need to work on the incident any more."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2024 11:52 AM - edited ā05-30-2024 08:37 AM
@1_DipikaD - you can use an onChange BR to generate an event and pass oldValue.managed_by as an event parameter. Trigger the notification on event with recipient being contained in event parameter.
Task 1 = Create the event by going to the Event Registry (search in Nav Menu Filter). Set the table to be "incident" and call it something like "incident.assignement_changed" with an appropriate description (such as "Event triggered when the assignment group of an incident changes").
Task 2 = Create the notification by going to "Notifications" (System Notification > Email > Notifications) and click "New". Use an appropriate name (such as "Notify Group Manager on Assignment Group Change") and set the table as "incident". Set the "when to send" to be "event is fired" and specify the event name that you crated in Task 1. Set the "who will receive" to "Event parm 1 contains recipient" and complete the "what it will contain" to your requirements (you will probably have to pass the incident number via event parameters also)
Task 3 = Create the BR as an onChange/insert/before, watching assignemnt_group. The script needs to dot-walk for the recipient value and then generate the event, passing the manager email and incident number as parameters (example below, adjust for your needs):
var oldGroup = new GlideRecord('sys_user_group');
if (oldGroup.get(previous.assignment_group)) {
// Get the manager of the old group
var manager = new GlideRecord('sys_user');
if (manager.get(oldGroup.manager)) {
// Fire the event
gs.eventQueue('incident.assignment_changed', current, manager.email, current.number);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2024 08:06 PM
so what did you start with?
you can use eventQueue approach and send email to old group manager
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader