Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Exclude notification recipient

MariaVitorS
Tera Contributor

Hi guys, can you help me? I have a notification that runs on the sc_task and is sent to the Assignment group, but I need to somehow create a rule that checks if user A is in this group the notification is not sent to him, only to this user, how can I do this?

1 ACCEPTED SOLUTION

Robert H
Mega Sage

Hello @MariaVitorS ,

 

You can create such a rule by creating a new entry in the "sys_recipient_notif_preference" table. Essentially it will be the same result as if that user had disabled this notification in their Notification Preferences.

 

Here is an example that shows how a certain email notification can be disabled for the system admin. Please note that you will have to pick a random existing record from the above table and create a copy of it (via Insert and stay) because the first field "Notification table" does not have any selectable choices. Then adjust the fields shown in red as needed.

 

RobertH_0-1743445625561.png

 

Regards,

Robert

View solution in original post

4 REPLIES 4

Robert H
Mega Sage

Hello @MariaVitorS ,

 

You can create such a rule by creating a new entry in the "sys_recipient_notif_preference" table. Essentially it will be the same result as if that user had disabled this notification in their Notification Preferences.

 

Here is an example that shows how a certain email notification can be disabled for the system admin. Please note that you will have to pick a random existing record from the above table and create a copy of it (via Insert and stay) because the first field "Notification table" does not have any selectable choices. Then adjust the fields shown in red as needed.

 

RobertH_0-1743445625561.png

 

Regards,

Robert

 

Hello @Robert H 
I didn't have any records so I filled them in via Scripts - Background and it worked!!! Thank you very much

Hello @MariaVitorS ,

 

Glad to hear that. Just letting you know that I found an even easier way if the table is empty:

Run the filter "Notification table = sysevent_email_action", then click the New button and that field will be auto populated. You can then select the actual notification and the user as usual.

 

Regards,

Robert

Cool, thanks @Robert H !