- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 01:55 AM
Hello!
I am working on a catalog item which goes through approval. Once the RITM is approved, a Catalog Task is created. Is there a way to add the name of the approver to the Task work note? For example: Approved by ServiceNow Guru.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 02:50 AM
If you are using flow designer no need to use glide script, see the following screenshots, for flow designer actions to get the approver record and create catalog task.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 02:28 AM
Hi @ceraulo ,
We can glide the sysapproval_approver table and fetch the approver name. If you are using workflow you need to use the run script, if you are using flow you can use look up record. For example,
var gr = new GlideRecord('sysapproval_approver');
gr.addEncodedQuery('state=approved^sysapproval=' + current.sys_id);
gr.query();
if(gr.next()){
workflow.scratchpad.approver_name = gr.approver.name;
}
You can use scratchpad variable to add it to the comments.
If it is pretty much straight forward, you can directly use the look up record in create catalog task action.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 02:38 AM
@AnveshKumar M, I am using Flow Designer. Can you guide me on how to do it? This is my first time to use GlideRecord scripting in Flow Designer. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 02:50 AM
If you are using flow designer no need to use glide script, see the following screenshots, for flow designer actions to get the approver record and create catalog task.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2023 03:01 AM
This worked. Thank you!