- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 04:26 AM
Hi All,
I have created a notofication to trigger when an incident is reassigned to another team , it will trigger notification to the previous assignment group. But now we have a requirement when the state of that incident changes to resolved/closed/cancelled also we need to trigger notification to previous assignment group. I tried adding condition in BR, but its not working. Any suggestions will be realy helpful for me. below are the script screen shots.
BR:
Event:
Notification:
In "when to" condition i just selected event fired and selected the event name, and in "who will recieve" i have checked event param 2. Please suggest me where i need to do the changes
Regards,
Tejaswini RG
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 05:00 AM
Hi
Your BR will give you previous assignment group when it is changed. But later it will not be available. My suggestion is to add the members of the previous group to the watchlist so that whenever state changes the members of the watch list gets notification.
In the same Br you can fetch the users and can add to watch list
//fetch existing watchlist members
var watchlist = current.watch_list.toString().split(",");
var users=[];
for(i=0;i<watchlist.length;i++) {
users.push(watchlist[i]);
}
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group",previous.assignment_group);
gr.query();
while(gr.next()) {
users.push(gr.getValue("user"));
}
current.watch_list=users.toString();
current.update();
Mark the comment as helpful/correct if this solves the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 05:00 AM
Hi
Your BR will give you previous assignment group when it is changed. But later it will not be available. My suggestion is to add the members of the previous group to the watchlist so that whenever state changes the members of the watch list gets notification.
In the same Br you can fetch the users and can add to watch list
//fetch existing watchlist members
var watchlist = current.watch_list.toString().split(",");
var users=[];
for(i=0;i<watchlist.length;i++) {
users.push(watchlist[i]);
}
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group",previous.assignment_group);
gr.query();
while(gr.next()) {
users.push(gr.getValue("user"));
}
current.watch_list=users.toString();
current.update();
Mark the comment as helpful/correct if this solves the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 05:44 AM
Hi, I tried above method, but its not working, its not triggering notification when the state changes.
In script also you didnt mention about state change rite?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 06:00 AM
Hello Tejaswini
The code that i shared will only add the previous group users to the watch list.
When the group changes, verify if the watch list is updated with the previous groups users or not.
Once that is done, then in your notification, where you wrote for state change, under user/fields, select watchlist as a recipient, then the notification will be sent to those users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 03:47 AM
Hi Asifnoor,
I added the watch_list as recipient and i saw that watch_list is also updated, but when the state changes its still not triggering the notification. Only when the assignment group changes that time only its triggering notification, I want to trigger when the incident state changes then also it should send notification to old grp members. Can you pls suggest?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 04:07 AM
Hello Tejaswini
In the notification, under filter conditions mention
assignment_group changes
OR
state changes
and check.
Mark the comment as a correct answer and also helpful if this solves the problem.