- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 01:01 PM
Hello,
The following email notification is for Change Request and it is triggering from sysapproval_approver table with an email template.
However, it is missing Request By name on the notification.
I tried to capture it in the email script, but it is returning "null" value:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gr = new GlideRecord("change_request");
gr.get(current.sys_id); // Replace 'your_sys_id_here' with the actual sys_id value
template.print(gr.getDisplayValue('requested_for'));
})(current, template, email, email_action, event);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:15 PM
Please modify your script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gr = new GlideRecord("change_request");
gr.get(current.sysapproval); // Replace 'your_sys_id_here' with the actual sys_id value //sysapproval field has the sysid of the change request
template.print(gr.getDisplayValue('requested_by'));
})(current, template, email, email_action, event);
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:10 PM
Hi @Keang , your screenshot says requested by but your script says requested_for. requested_for does not exist on change_request table.
Thanks,
Swapnil Deo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:15 PM
Please modify your script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gr = new GlideRecord("change_request");
gr.get(current.sysapproval); // Replace 'your_sys_id_here' with the actual sys_id value //sysapproval field has the sysid of the change request
template.print(gr.getDisplayValue('requested_by'));
})(current, template, email, email_action, event);
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni