User not part of group but still receiving notifications.

Ankit69
Tera Contributor

User is receiving notifications for group but he is not part of the group.

Notification is on sn_hr_core_case table. It gets sent when event is fired. Who will receive has Event parm 1 contains recipient checked and Send to event creator checked.

Business Rule is on sn_hr_core_case table. It runs after insert/update on conditions State is Work in Progress and Assigned to is empty.

Following is the BR script, please validate if the script is correct or need any changes. I feel we need to query with group.sys_id as it is reference field.

(function executeRule(current, previous /*null when async*/ ) {
/*en = En = English or (System Default English)*/

var approverGr = new GlideRecord("sys_user_grmember");
approverGr.addQuery('group', current.assignment_group);
approverGr.query();
var approverList = [];
while (approverGr.next()) {
approverList.push(approverGr.getValue("user"));
}
gs.eventQueue("sn_hr_core.hr.case.assigntogroup.En", current, approverList.join(","));
})(current, previous);

@Ankur Bawiskar @Chuck Tomasi 

10 REPLIES 10

Jaspal Singh
Mega Patron
Mega Patron

Since, Event creator is checked is the same person who is receiving mails & still not part of group?

You need to uncheck Event creator.

Additionally, just check if there exists any Delegate entry for the any of group member in Delegate table. If so, you can plan to check the Exclude Delegate checkbox in the notification's Who will receive tab

Community Alums
Not applicable

Hi Ankit,

This is what you have to do :

https://community.servicenow.com/community?id=community_question&sys_id=4cd0cebbdb9d5c10d82ffb243996...

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

Ankit69
Tera Contributor

@Sandeep Dutta @Jaspal Singh This is happening when the assignment group changes on hr case, previous group members are getting notified and also new group members are getting notified.

Do we need to add any condition in business rule to turn off the email triggering to previous group members?

Hope the Business Rule runs after & not before.