- 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 08:13 PM
You are printing only string "Details", how will it fetch the history of approval?
If you want to pull the history try pulling different fields :
template.print(gr.getValue("approver") + " "+gr.getValue("state"));
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:42 PM
Thank you very much! Got it to work.