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.

Filter notification by role

chahinazekbz
Tera Contributor

Hi everyone,

 

I need some help with a notification issue.

I have a group of users with the “partner” role, and I want them to receive only three specific notifications — the ones whose names contain “Partner” (name in notification table )— and no others.

 

Since there are currently over 500 notifications on the platform, I can’t modify them manually.

 

I thought about creating a Business Rule on the sys_email table with a condition like:

 

if the user has the “Partner” role and the email subject doesn’t contain “Partner”, then abort the email.

 

However, the problem is that the three notifications don’t have any common keyword in their subject or name, so I can’t easily filter them that way.

 

thank you 

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@chahinazekbz 

you can use before insert business rule and see the recipients

1) if recipient user has partner role -> query sys_user with the email address

AND

2) if subject contains Subject 1 or Subject 2 or Subject 3

If above conditions match then use current.setAbortAction(true)

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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