- 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-12-2020 02:37 AM
Hi,
is your notification on change_request?
Also you want to show that approver name for the record which has been approved
then only the query would run
please check by adding logs
var appName = new GlideRecord('sysapproval_approver');
appNew.addQuery('document_id',current.getValue('sys_id'));
appNew.addQuery('state','approved');
appNew.query();
if(appNew.next()){
gs.info('Inside');
template.print('Approver Name is : '+appNew.approver.getDisplayValue());
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 02:58 AM
I need to get approver name who has approved change request.
Please help me with this.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 03:04 AM
Hi Nivedita,
If this setup is in personal instance and you are ok to share details; please share url and some admin credentials here ankurb.snow@gmail.com
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 03:13 AM
This is not pdi. I can't share details.
I have written below code to get approver name who has approved this change request but I'm not getting any value.
Please help me with this.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 03:19 AM
Hi,
when you added logs what came in logs?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader