Pulling a field from approval table to requested item table into a Notification email

TMKAM
Tera Contributor

Hi All,

I want the approver name from this Approval (sysapproval_approver) table into the current notification Requested Item (sc_req_item) table.

How do I scripted that.

Regards,

TMKam

2 ACCEPTED SOLUTIONS

@TMKAM 

it should work if there are approval records in Requested state in sysapproval_approver table for your RITM

Did you verify that?

You can comment line 7 and see what it prints.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

Hello @TMKAM, you seem to be sending the notification when RITM is cancelled, then approval might be moved out of 'Requested' state. could you please try once more by commenting following line from the code?

approvalGR.addQuery('state', 'requested'); //comment this

 

Regards,

Nishant

View solution in original post

15 REPLIES 15

@TMKAM 

instead of var approverName = approverGR.approver.name; can you try 

 

//var approverName = approverGR.approver.getDisplayValue();