- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 07:49 PM
I have to set approval rejected user to populate in email notification. Notification i have written on Change_request table.
Here my script:
appr = new GlideRecord('sysapproval_approver');
appr.addQuery('state', 'rejected');
appr.addQuery('sysapproval', current.getUniqueValue());
appr.query();
if (appr.next()) {
template.print(appr.getDisplayValue('approver'));
email.setSubject(approver);
}
It displaying user name in email body, but in subject line it is not working. Can any one help me on this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 07:17 AM
Replace
email.setSubject(sysapproval.number +"Rejected by " + approverName);
with
email.setSubject(appr.sysapproval.number +"Rejected by " + approverName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 07:59 PM
Hi,
You can use ${approver} in email subject
for example -
${sysapproval.sys_class_name} ${sysapproval} has been rejected by ${approver}
OR try this updated script.
var approverName = '';
appr = new GlideRecord('sysapproval_approver');
appr.addQuery('state', 'rejected');
appr.addQuery('sysapproval', current.getUniqueValue());
appr.query();
if (appr.next()) {
template.print(appr.getDisplayValue('approver'));
approverName = appr.getDisplayValue('approver');
email.setSubject("Rejected by user: " + approverName);
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 08:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 08:51 PM
Just try with
${number} Rejected by ${approver}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 03:04 AM
I have tried this but it is populating wrong user name. Ex: I have group approval if any one approves it needs approve. if 'A' rejects from the group i need to populate 'A' name. right now it is displaying other name.
thanks,
prasad
