- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 09:08 AM
Hi All,
Im making a workflow for a request.
Its all working well but im struggling with one bit ..
There is an approval widget and the 'approved' branch then goes to a new catalog task.
In that catalog task, I want to reference the name of the person who approved it.
So for example, somewhere in the description of the catalog task , i would like a line that says "this has been approved by xxxx"
But i cant find a way to reference the approvers name - can anyone help me with a way to achieve this please ?
Many thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 09:52 AM
Hi,
There can be one person approving it or more than 1 also approving it for say Group Approval is there are any. So I would suggest here is write a Script in the Advanced section of your Catalog task activity and use the script below:
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.sys_id);
gr.addQuery('state','approved');
gr.query();
while(gr.next()){
task.description = 'This Request has been approved by ' + gr.getDisplayValue('approver');
}
Use this script in the screenshot below in Catalog Task activity itself:
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 02:04 AM
This works perfectly - thank you