Delegate User Not Receiving Specific Approval Notifications When "All Notifications" Is Unchecked
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16m ago
Hi Team,
I'm trying to implement a requirement where a delegate user should receive approval notification emails only for IT Shopping Cart approvals, while all other delegated approval notifications should continue to be suppressed.
Current Configuration
On the User Delegate record (sys_user_delegate):
- Approvals = Checked
- All notifications = Unchecked
The expected behavior is:
- The delegate should receive email notifications for IT Shopping Cart approval requests only.
- The delegate should not receive notifications for any other approvals.
What I Have Tried
I created a custom mail script and added it to the IT Shopping Cart approval notification. The script looks up active delegates and manually adds them as CC recipients:
Javascript:
(function runMailScript(current, template, email, email_action, event) {
var delegate = new GlideRecord('sys_user_delegate');
delegate.addQuery('user', current.approver.sys_id);
delegate.addQuery('starts', '<=', gs.nowNoTZ());
delegate.addQuery('ends', '>=', gs.nowNoTZ());
delegate.addQuery('approvals', true);
delegate.query();
while (delegate.next()) {
var usr = new GlideRecord('sys_user');
usr.addQuery('sys_id', delegate.delegate);
usr.addQuery('notification', '2');
usr.addQuery('active', true);
usr.query();
while (usr.next()) {
email.addAddress('cc',usr.email.toString(),usr.name.toString());
}
}
})(current, template, email, email_action, event);
Issue
This works only when the "All notifications" checkbox is checked on the delegate record.
If "All notifications" is unchecked:
- The approval is correctly delegated.
- The delegate can act on the approval.
- However, the delegate does not receive the email notification, even though the mail script is adding the delegate as a CC recipient.
Questions
- Does ServiceNow suppress delegate recipients when All notifications is unchecked, even if they are added manually through email.addAddress()?
- Is there a recommended approach to send notifications only for specific approval types (such as IT Shopping Cart approvals) to delegates?
- Has anyone implemented a similar requirement where delegates receive only selected approval notifications while keeping All notifications disabled?
Any suggestions or best practices would be appreciated.
Thanks in advance!
0 REPLIES 0