Need to get approver name.

niveditakumari
Mega Sage

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 

 

1 ACCEPTED SOLUTION

Hi Nivedita,

 

 

Replace approv.query(); with below in your code once.

approv.addQuery('state','approved');

approv.orderByDesc('sys_upated_on');

approv.query();

View solution in original post

17 REPLIES 17

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I need to get approver name who has approved change request. 

Please help me with this. 

 

Regards, 

Nivedita 

 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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 

 

Hi,

when you added logs what came in logs?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader