Add approver to catalog task work note

ceraulo
Mega Guru

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.

1 ACCEPTED SOLUTION

@ceraulo 

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.

 

AnveshKumarM_0-1681465762748.png

 

AnveshKumarM_1-1681465787454.png

 

 

 

 

 

Thanks,
Anvesh

View solution in original post

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

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.

 

 

Thanks,
Anvesh

@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.

@ceraulo 

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.

 

AnveshKumarM_0-1681465762748.png

 

AnveshKumarM_1-1681465787454.png

 

 

 

 

 

Thanks,
Anvesh

This worked. Thank you!