how to populate assigned to field in catalog task who approves that RITM

Deepika43
Tera Contributor

In my requirement, flow designer were created for the catalog item. Now,  the Assigned to field is populated with the name of the person that provided the approval. 
I tried with the script for assigned to field. But, not working as expected.

 

1 ACCEPTED SOLUTION

Hi @Deepika43

Can you please use the below script:

var sysId = fd_data.trigger.request_item.sys_id;
// pick the latest approver
var gr = new GlideRecord("sysapproval_approver");
gr.orderByDesc("sys_updated_on");
gr.addQuery("state","approved");
gr.addQuery("sysapproval", sysId);
gr.setLimit(1);
gr.query();
if(gr.next()) {
return gr.approver;
}

I hope this will solve your problem. Please mark it as Accepted and Helpful.

GoodWill,
Anshul

View solution in original post

13 REPLIES 13

Deepika43_0-1694773434475.png

still task created with empty assigned to

 

Hi @Deepika43

Can you please use the below script:

var sysId = fd_data.trigger.request_item.sys_id;
// pick the latest approver
var gr = new GlideRecord("sysapproval_approver");
gr.orderByDesc("sys_updated_on");
gr.addQuery("state","approved");
gr.addQuery("sysapproval", sysId);
gr.setLimit(1);
gr.query();
if(gr.next()) {
return gr.approver;
}

I hope this will solve your problem. Please mark it as Accepted and Helpful.

GoodWill,
Anshul

Deepika43
Tera Contributor

Thank you @anshul_goyal its working

No problem @Deepika43. Thanks for accepting my answer!!