Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 04:52 AM
Hi @Madhan007 ,
you script looks good it should work
cc and bcc will be populated in the copied and Blind Copied field of the email
you can also use this script but your script should work fine
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var approvalgr = new GlideRecord('sysapproval_approver');
approvalgr.addQuery('sysapproval', current.getValue('sysapproval'));
approvalgr.query();
while (approvalgr.next()) {
if (approvalgr.approver && approvalgr.approver.email) {
var emailString = approvalgr.approver.email.toString();
var displayName = approvalgr.approver.name;
email.addAddress("cc", emailString, displayName);
}
}
})(current, template, email, email_action, event);in the background script context the email parameter is undefined so it will throw the error
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya