- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 10:22 PM
I Have a requirement to print the approver name in the notification, i have creation notification on sc_req_item , using a email script to achieve the result but it is not working :
Email script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 10:56 PM
Hi @avinashdubey103 ,
Please use the below code in your email script to get the approver name -
var approverName = '';
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval',current.sys_id);
app.query();
if(app.next()) {
approverName = app.approver.getDisplayValue();
}
template.print(approverName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 10:56 PM
Hi @avinashdubey103 ,
Please use the below code in your email script to get the approver name -
var approverName = '';
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval',current.sys_id);
app.query();
if(app.next()) {
approverName = app.approver.getDisplayValue();
}
template.print(approverName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 10:59 PM
Please use this script to fetch the approver...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 11:05 PM
Use the below script
if (stateRitmNumber == "requested") {
var approver = '';
var approverGR = new GlideRecord('sysapproval_approver');
approverGR.addQuery('sysapproval', current.sys_id);
approverGR.query();
if (approverGR.next()) {
approver = approverGR.approver.getDisplayValue();
}
template.print("<br><br><Strong>State : Pending Approval of ${0} </Strong> " + approver);
} else {
template.print("<br><br><Strong>State : </strong>" + stateRitm);
}
Regards,
Piyush Sain