- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 03:17 PM
Hello,
I am having an issue where a notification email is only being sent to the group email and not the members even after the 'Include members' field was checked on the group record. The event is firing correctly and email is being sent but I need to send emails to the group members as well. I know I can script and add all the users to the event parameter but I am trying to do as much out of the box.
Here's my notification:
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2019 10:41 AM
Use the below script in your scheduled job/script.
var mem = [];
var gr = new GlideRecord('sys_user_group');
gr.addEncodedQuery('managerISEMPTY^name=Service Desk'); //This will return only 1 group. Change it according to your requirement.
gr.query();
if(gr.next()){
if (mem.toString().indexOf(gr.sys_id) == -1) {
mem.push(gr.sys_id + ""); // It will give you sys_id of the group.
}
}
gs.eventQueue('Your event name',gr, mem.toString()); //This will trigger the event and the same event must be associated with your notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 08:00 PM
I wasn't able to get this working either... I ended writing a business rule on the task type.
something like this.
var user = new GlideRecord('sys_user_grmember');
user.addQuery('group',current.assignment_group);
user.query();
var list = new Array();
while(user.next()){
list.push(user.user.toString());
}
gs.eventQueue('notification.group',current,list.toString());
fires the event, and contains the member of the correct record assignment group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2019 10:41 AM
Use the below script in your scheduled job/script.
var mem = [];
var gr = new GlideRecord('sys_user_group');
gr.addEncodedQuery('managerISEMPTY^name=Service Desk'); //This will return only 1 group. Change it according to your requirement.
gr.query();
if(gr.next()){
if (mem.toString().indexOf(gr.sys_id) == -1) {
mem.push(gr.sys_id + ""); // It will give you sys_id of the group.
}
}
gs.eventQueue('Your event name',gr, mem.toString()); //This will trigger the event and the same event must be associated with your notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2019 04:59 PM
You would need a bit more info to understand why the group did not work. Hard to debug this without also seeing your group as well as configuration of each of the users included in the group.
Pretty sure it should work given the info you've provided - a script should not be needed here for this.
But you will need to dig a bit more to understand why individual members are not added.
Assume your group set to 'active'?
Are all your member users active?
Do they all have email addresses, and your group member users configured to receive notifications, with no filters preventing delivery? (Key: there are a number of reasons why a user might get stripped/excluded from your intended recipient list.)
and so on...
Use the Preview Notification button on your notification form to simulate your notification and recipients against an example target record your choice from the notification's table, and then debug from there. For any user shown in the Preview, excluded users strike-thru and included ones don't. Hover over any user to see the include/exclude reason text.
Alternatively, you can see the same info logged after you fire the notification - open the generated email record, and the related email log also will list recipient inclusion/exclusion reasons.