- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 04:25 AM
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
Solved! Go to Solution.
- Labels:
-
Analytics and Reports

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 04:31 AM
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 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 04:28 AM
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');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 04:31 AM
I think your query for approved is incorrect, shouldn't it be
gr.addQuery('state','approved')// quotes are missing
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 04:31 AM
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 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:02 AM
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