Add Approver History to notification

achen
Tera Contributor

Hello,

 

I am attempting to pull the approval history from a ritm and add it to a notification.  I have added this email script 

var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);

gr.addQuery('state',approved);gr.query();

while(gr.next()){
template.print('Details');
}

but it pulls all approvers from the approval table and not the approvals for the current ritm.

 

Thank you,


Alex

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

I think your query for approved is incorrect, shouldn't it be

gr.addQuery('state','approved')// quotes are missing

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

View solution in original post

6 REPLIES 6

achen
Tera Contributor

I have also attempted to add this script as well.

var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);

gr.addQuery('state',approved);gr.query();

while(gr.next()){
template.print('Details');
}

I think your query for approved is incorrect, shouldn't it be

gr.addQuery('state','approved')// quotes are missing

Best Regards
Aman Kumar

Aman Kumar S
Kilo Patron

Hey,

I think your query for approved is incorrect, shouldn't it be

gr.addQuery('state','approved')// quotes are missing

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

Hello,

 

After adding the quotes to approved the email notification is now showing, "DetailsDetailsDetailsDetails".

Before when using that script it was blank but it is still not pulling in the approval history.

 

Alex