Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 01:20 AM
I need help! I have a notification that I send an event and Business Rule to and the code works partially but the assignment_group does not work for me and the goal is that as soon as there is a group then the notification will be sent to the members of the group is there a possibility that someone could correct the code for me in these lines? Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 03:34 AM
Assignment group is not an array, it is a reference field that holds a single sys_id from the sys_user_group table. If you have the Group email field populated on your groups, use the same syntax as assigned_to. If you are not using this field and want to trigger the event to each member of the group, you would need something like this:
} else if (current.assignment_group) {
var userIds = new Array();
var userGR = new GlideRecord('sys_user_grmember');
userGR.addQuery("group", current.assignment_group);
userGR.query();
while (userGR.next()) {
userIds.push(userGR.user.toString());
}
for (var i=0; i<userIds.length; i++) {
then use userIds[i].email.toString() in your event call