0

Step 1. Create new mail Script

Name:get.catalogname

(function runMailScript(current, template, email, email_action, event) {
     var item = new GlideRecord("sc_req_item");
     item.addQuery("request", current.sys_id);
     item.query();
     while(item.next()) {
     var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();
     var email = item.variables.email;
     template.print(catalogItem + "<br/> Email: " + email);
     }
  })(current, template, email, email_action, event);

Step 2:

Add below code in Notification Body:

${mail_script:get.catalogname}

How to call email script in notification ServiceNow?
Expert Edited question July 14, 2023