Turn off notification for a group

NieugietyB
Tera Contributor

Hi,

 

is it any option to turn off every notification for the whole group members?

Case scenario:

incident is about to trigger a notification for a group XYZ assigned in the assignment group field. We don't want this XYZ group members to receive any notification in this case, however if the field assignment group would have any other group then it normally triggers the notification. As well as if these users were in a different group than XYZ and in the exact situation above they would normally receive such notification.

 

Meaning:

We don't want to turn off on each user record the notification field to disabled, since we want notification for these users if they were in any different group. As well we cannot add to each notification a condition that assignment group is NOT XYZ since there are too many different notifications, as well as cases in which any notification should be triggered.

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@NieugietyB 

you can do this using after update business rule, event and notifcation

1) let the business rule run after update with proper condition and it will check what's the group. if Group is not XYZ then it will fire the event using eventQueue

2) create event on your incident/whatever table

3) create notification on your table and link the above event. ensure Event parm1 contains Recipient = True

Business rule script to get the members and then fire the event

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var userArr = [];
    var gr = new GlideRecord("sys_user_grmember");
    gr.addQuery("group", current.assignment_group);
    gr.query();
    while (gr.next()) {
        userArr.push(gr.getValue('user'));
    }

    gs.eventQueue('eventName', current, userArr.toString());

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

anil_mishra11
Tera Expert

Hi @NieugietyB ,

 

There are 2 ways to do it.

 

1st :

You can try impersonating the user. Then go to Top Right Corner (user icon)> Preferences>Notifications>Advanced preferences. Here search for your notification and disable it.

anil_mishra11_0-1740671099825.png

 

 

2nd:

Add a condition to your notification - 

 

Assignment Group -> IsNot -> [Name of your assignment group]

This would refrain the notification from triggering.

anil_mishra11_1-1740671285687.png

 

Please mark my answer as helpful, accept it as solution , if it answers your query.