We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to transfer approval request from one user to another using button.

PoojaD900590353
Tera Contributor

How to transfer approval request from one user to another user using button.

For eg:- I have a requirement were i need to transfer approval request from able tuter to alex.

 

1 REPLY 1

Curtis_Myers1
Tera Contributor

We had a similar requirement, our was Escalate the the Approver's Manager and set to Current Manager.

We created a UI Action button for each case and restricted the access to the Service Desk users.

 Name: Escalate to Approver's Manager

Table: Approval [sysapproval_approver]

Condition: current.state == 'requested' && current.sysapproval.sys_class_name != 'wm_order'

Script:

var mgr_mgr=current.approver.manager;
if(mgr_mgr){
    current.approver=mgr_mgr;
    current.update();
}

 

Name: Reset to Current Manager

Table: Approval [sysapproval_approver]

Condition: current.state == 'requested' && current.sysapproval.sys_class_name != 'wm_order'

Script:

var gr=new GlideRecord(current.source_table);
gr.addQuery('sys_id',current.document_id);
gr.query();
if(gr.next()) {
    var mgr = gr.requested_for.manager;
    if(mgr!=current.approver && mgr){
        current.approver = mgr;
        current.update();
    }
}


Hope this helps