How to check if the manager of the User has Approved RITM in workflow.

Community Alums
Not applicable

Suppose there are Approvals generated for RITM. Then in the workflow we must make modifications such that, if Manager of the user(Requested for) has Approved it then other Approvals should become no longer required otherwise we need Approvals from all the Approvers.

Please let me know how to proceed with this ? And also provide sample script that needs to be written in workflow.

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

I have used below code in Approval Script to achieve this.

 

var gr = new GlideRecord('sysapproval_approver');

gr.addQuery('sysapproval', current.sys_id);

gr.addQuery('approver', current.request.requested_for.manager);

gr.addQuery('state', 'approved');

gr.query();

if(gr.next()){

              answer = 'approved';

}

View solution in original post

4 REPLIES 4

Shekhar Deshing
Mega Expert

Once you ordered under ITEM list you can able to see RITM Request and in 3rd Column Stage -

There you can see Workflow List you can opne the RITM and can see the status on Workflow with whom is pending.

Community Alums
Not applicable

Sorry my question may have confused you, but I want to code this in workflow, so that if manager has Approved the RITM then other Approvals should become No Longer Required

Vishal90
Kilo Contributor

also there will be notifications configured. once approved user will get a notification.

Community Alums
Not applicable

I have used below code in Approval Script to achieve this.

 

var gr = new GlideRecord('sysapproval_approver');

gr.addQuery('sysapproval', current.sys_id);

gr.addQuery('approver', current.request.requested_for.manager);

gr.addQuery('state', 'approved');

gr.query();

if(gr.next()){

              answer = 'approved';

}