- 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 04:35 AM
Hello,
Check this thread for help,
If answer is helpful please mark correct and helpful!
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 04:42 AM
Yes, using this link only i have created notifiction, now i want to add the some more condition that is the state of the incident changes, that time also i need to send the notification to previous assignment group, when i add sondition in BR, its not working so seeking some help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 04:46 AM
Is your requirement to send the notification to the previous group when the incident is reassigned, or when the incident is both reassigned AND resolved / closed / canceled? Or is it when the incident is reassigned OR is resolved / closed / canceled?
When the incident is first reassigned (assignment group > changes from) you have access the value of the previous.assignment_group. (which is why your first scenario works).
When the incident is later changed to resolved / closed / canceled, there is no value for previous.assignment_group as that value was not changed during the current operation.
You would need to do something like add a field on incident to hold the value of the previous assignment group (populate the field when the assignment group changes) and then write a second business rule that is triggered when the incident state changes to resolved/closed/canceled and if your previous assignment group field has a value, and then send the notification.
Hope this helps!
If this was helpful or correct, please be kind and click appropriately!
Michael Jones - Proud member of the CloudPires Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 04:21 AM
Hi Michel,
I just added 1 field on incident form which hold the previous assignment group and i am not getting the code to write the second BR, can you help me pls with the code. I will just try.