- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2015 12:29 PM
Hello All,
I could use some help. I have been trying to get a rejected notification email to include the approver's rejection comments. I have tried several scripts to get his to work without fruitful results. The notification is targeting the sysapproval_approver table.
I tried the tree picker and then previous articles on the community to find an answer that works.
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.addQuery('comments', current.comments);
gr.query();
if(gr.next()){
template.print("Rejected comments: " + gr.comments.getJournalEntry(1);
}
Thanks for any help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2015 12:52 PM
Try removing the gr.addQuery('comments;, current.comments);
once you return from the query(), then just get the comments.
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.addQuery('comments', current.comments); Remove this line
gr.query();
if(gr.next()){
template.print("Rejected comments: " + gr.comments.getJournalEntry(1);
}
If you still have trouble getting the comments, try setting getJournalEntry to -1;
Tom

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2019 08:42 PM
Hi,
This did not work for me. I have the same requirement and i am useing the same email script mentioned above and pulled out on the body of the notification made on the kb_knowledge table. No Luck for me. It is generating the notification but not pulling the comments.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2019 07:17 AM
I had the same results after creating the script. Unfortunately, the notification fired but the comments appear null.