Email Notification Not triggered to an e mail address in CC with Priority changed for an incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2026 09:54 AM
Dear Experts,
I am running into an issue. I drew a notification script for specific user groups.. The notification is getting triggered to a specific group e mail address in CC but when the priority is raised, the notification is going to the group members but the cc (group e mail) is missing. what Can be the reason. A quick reply will be appreciated.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var propertyValue = gs.getProperty('evr.incident.notification.groups', '');
if (!propertyValue)
return;
var targetGroups = propertyValue.split(',');
var currentGroup = current.getValue('assignment_group');
var isTargetGroup = false;
//Check if the current record has an assignment group in our property list
if (current.isValidField('assignment_group') && !current.assignment_group.nil()) {
isTargetGroup = targetGroups.indexOf(currentGroup) !== -1;
}
var isPriorityChanged = current.priority.changes();
//gs.log('isTargetGroup: ' + isTargetGroup + ', isPriorityChanged: ' + isPriorityChanged, 'company_NOTIFY');
if (isTargetGroup || isPriorityChanged) {
email.addAddress('cc', 'M365Support@company.com', 'M365 Support');
//gs.log('Added CC: M365Support@company.com', 'NB_NOTIFY');
}
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2026 11:19 AM - edited 06-10-2026 11:20 AM
Hi @Nilanjan1
Instead Of following line
var isPriorityChanged = current.priority.changes();
Try with mentioning Priority and try
var isPriorityRaised = (current.priority == 1 || current.priority == 2);
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti