Exclude users from receiving notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Community,
I want to exclude 9 users from receiving notifications and these notifications gets triggered by a schedule Jobs which runs daily. Can I use conditional script in the scheduled Job or do I need to write an email script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @ShubhankarK9612 ,
You can disable all notifications or only specific notifications as needed. To do this, navigate to Profile → Preferences → Notifications. (Ensure that these settings must be configured individually for each user.)
If you turn off the main toggle, the user will not receive any notifications.
To disable only selected notifications, click the arrow next to System Notifications. Use the search bar to find the required notification and turn it off. This will ensure that only that specific notification is disabled, while all others continue to be received.
Please mark it as helpful, if it works for you
Thanks,
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi there @ShubhankarK9612
you can handle this directly in the Scheduled Job script. somethnmg like this
var excludedUsers = [
'46d44f2d1b223010a1b2f1c4cd4bcb12',
'8a9c3b9d1b223010a1b2f1c4cd4bcb99'
];
var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
if (excludedUsers.indexOf(gr.sys_id.toString()) > -1) {
continue; // skip excluded users
}
gs.eventQueue('custom.notification.event', gr, gr.email, '');
}
This works, but keep in mind that embedding exclusion logic in scheduled jobs makes maintenance harder over time. If the list changes often, a group-based exclusion or notification condition/email script is
Kind Regards,
Azar
Serivenow Rising Star ⭐
Developer @ KPMG.
