The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Add cc mail address in notification

Siva82
Tera Expert

Hi Team,

 

I Have created mail script to pass cc mail id address in my notification; I have below script in mail script it does not work.

(function runMailScript(current, template, email, email_action, event) {

var ritm = current.request_item;

if (!ritm) {
gs.info("RITM not found in notification script");
return;
}

var servicetype = ritm.variables.service_type;
gs.info("Service Type in notification: " + servicetype);

if (servicetype === 'csq') {
email.addAddress('cc', 'CustomerSecurityQuestionnaires@TEST.com', 'Customer Security Questionnaires');
} else if (servicetype === 'contract') {
email.addAddress('cc', 'SecurityContractReview@exchange.TEST.com', 'Security Contract Review');
template.print("Service Type: " + servicetype);
} else if (
servicetype === 'customer_audit' ||
servicetype === 'customer_special_request' ||
servicetype === 'security_certification'
) {
email.addAddress('cc', 'CustomerTrust@TEST.com', 'Customer Trust');
}

})(current, template, email, email_action, event);



can you please help me on that.

thank you 

Sivananda reddy
7013042794

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Siva82 

so notification is on sc_task table

Are you able to get the variable value?

what debugging did you do?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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