Regarding notification send to assignment group manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2024 11:42 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. How to get this done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2024 11:51 AM - edited ā05-29-2024 12:20 PM
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);
}
}