How to add comments in approval from Workflow activity user approval

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 03:43 PM
I tried the code: current.sysapproval.comments = "Please provide Approval for "; but I get the error "illegal access to getter method getmessage in class org.mozilla.javascript.rhino exception"
Any thoughts? I don't want to do a BR .
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 04:18 PM
you can configure run script activity after approval activity to update approval record comments as per your requirements.
In run script, you can query sysapproval record and update comments.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 07:25 AM
How would the query look to make sure I get the right approval? This workflow has 3 levels of approval and so I want to make sure I put the comments specific to approval on the correct approval.
Thanks so much for your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 10:30 AM
yes, you need to add run script activity after approval activity.
First you need to run script to get correct approval record after after approval activity. Also, you need to add timer after approval activity finishes
you can use below
var arr=[];
var gr= new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.sys_id);
gr.query();
while(gr.next()){
arr.push(gr.getValue('sys_id')); //this will contain all the sys_id
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 10:41 AM
Sachin, unfortunately your suggestion won't work. Jerin wants to add a comment to the approval as that approval is created. As you know workflows will pause on Approval activities and remain on them until the approval has been approved or rejected so your suggestion of a run script AFTER this activity will update the approval too late.