We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Exclude users from receiving notifications

ShubhankarK9612
Tera Contributor

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. 

11 REPLIES 11

@ShubhankarK9612 

you are not setting recipients from here

How are you setting it? at notification level?

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Yes, at the notification level

@ShubhankarK9612 

then you need to do this

-> don't add any field in Who will Receive tab in notification

-> set Event parm1 contains recipient as True

-> then update script to include only those recipients you want

something like this but please enhance

// push user sys id in array
var recipients = ['userSysId1', 'userSysId2', 'userSysId3'];

gs.eventQueue('Incident.not.updated.for.5.days', gr1, recipients.toString());

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@ShubhankarK9612 

Thank you for marking my response as helpful.

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

ShubhankarK9612
Tera Contributor

Can anyone help me with the script ?