Disable a certain Notification for a entire group

Cedric J
Tera Contributor

I want to block some Notification to be sent to certain assigment groups, the assigment group has a group mailbox.

For example, a assigment group dont want to get the "There is a new WorkNote" Notification.

There is the table cmn_notif_message where i could define a notification and a group, but this is not working.

 

How can I achive this ?

 

 

7 REPLIES 7

Hi @Chaitanya ILCR ,
this only works with User but not with entire groups.
Can you perhaps tell me what i do wrong ? This is my config.

CedricJ_0-1741776247157.png

 

Hi @Cedric J ,

1.May be the group's email field is empty.

2. May be Group's include members flag is set to true.

 

you can create a BR or Flow on sys_gr_member table with with condition as group "is one of" one of your group for which the notifications should be disabled and create a record in 

 

ChaitanyaILCR_0-1741777437909.png

with script

ChaitanyaILCR_1-1741777537627.png

 

 

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

    var notificationList = ['8d692961d72322005aed4ebfae6103f5','8cfda33683f11610c4d11a30ceaad30d']; //array of notifications
    var notifPrefGr = new GlideRecord('sys_recipient_notif_preference');

    notificationList.forEach(function(item) {
        notifPrefGr.newRecord();
        notifPrefGr.notification_table = 'sysevent_email_action';
        notifPrefGr.recipient_table = 'sys_user';
        notifPrefGr.recipient = current.getValue('user');
        notifPrefGr.notification = item; //sysid of the notification
        notifPrefGr.send = false;
        notifPrefGr.insert();
    });


})(current, previous);

 

this way for each user whoever gets added to those group those listed notifications will be disabled as soon as they are part of listed groups.

 

And fix script for the existing users.

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

Hi @Chaitanya ILCR ,

that would be a good idea for all the users in groups. But for my use case there is a group email set in the assignment group. And that will not work. 
Do you have any other idea for a group with group email ?