
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2019 12:47 PM
I am looking for a way, perhaps through advanced conditions on an email notification to send only when the person updating the record is not a member of a specific group, or has a specific role.
Basically I have a group that needs to be notified any time a ticket is updated in the Additional Comments, Work Notes or Close Notes fields, but only if it is someone other than members of their group doing the updates. I'd like it to be dynamic rather than a bunch of "Updated by IS NOT X" conditions since group membership does change occasionally, and I don't want to have to update a large number of notifications if that does happen.
Any help is greatly appreciated. Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2019 12:59 PM
Sure thing, boss!
Remember, you have more than 1 way to trigger a Notification. Most commonly people use the condition builder logic, but that can run out of steam with just a little complexity.
The other solid option is to make Notifications trigger on an event (go to the Advanced view of the notification form and see that there's a When to Trigger choice list). So you go to your Event Registry and create a new event for the situation (notify.nonmember.update lets say).
Now you have a business rule capture the conditionality.
"When an incident is updated...." and in your script something like...
var membership = new GlideRecord('sys_user_grmember');
membership.addQuery('user',gs.getUser());
membership.addQuery('group',<sys_id of group in question>); //(or current.assignment_group if you want scalability)
membership.query();
if (membership.next()){
return;
} ele {
gs.eventQueue('notify.nonmember.update',current,parm1,parm2) //you can send 2 parns with each eventQueue call
}
Now just build your notification to be fired by the notify.nonmember.update event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 05:55 AM
Always appreciate some Kunzkeanwesung!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2019 10:04 AM