- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2020 02:59 AM
Hello,
Need to get approver name in notification.
ex - when change request is going to approval, i need approver name in HTML template.
Can anyone please help me with this.
Regards,
Nivedita
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 05:12 AM
Hi Nivedita,
Replace approv.query(); with below in your code once.
approv.addQuery('state','approved');
approv.orderByDesc('sys_upated_on');
approv.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 05:07 AM
Hi,
I have written this code and it is retrieving all approval name but i need only user who has approved it.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var appr_list = [];
var approv = new GlideRecord('sysapproval_approver');
approv.addQuery('document_id',current.sys_id);
approv.query();
gs.log('entered');
while(approv.next())
{
gs.log('entered in while loop');
appr_list.push(approv.approver.getDisplayValue());
}
template.print(appr_list);
})(current, template, email, email_action, event);
Please help me with this.
Regards,
Nivedita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 05:12 AM
Hi Nivedita,
Replace approv.query(); with below in your code once.
approv.addQuery('state','approved');
approv.orderByDesc('sys_upated_on');
approv.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2020 05:46 AM
Hi Jaspal,
It is working as expected.
Thank you so much for your help.
Regards,
Nivedita