Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Request item order page approval details

t venkatesh2
Tera Contributor

Hi,

I need to add the approver details on request summery page, once the service catalog request is submitted from ESC Portal request details(ex; REQ no, RITM no. Item, delivery date etc..) will be visible to the requester. in addition to that i want to add details of the approvers whom it is currently pending.

adding the screen shot for reference.

under Stage : 

Waiting for Approval (In progress) -> under this show the approvers details like pending with xyz user..
 
 Fulfillment (Pending - has not started)
 
 Completed (Pending - has not started).
please suggest the solution.
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@t venkatesh2 

no direct way to handle this.

You will have to clone the OOTB widget and make changes to it and then add that widget to your existing page.

Lot of customization and it will add technical debt to your platform.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

@t venkatesh2 

unless you start you won't learn

you can take help of some AI tool as well for this and you should be good

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

I have cloned the widget and modified the server-side script below is the script.

-------------------------------------------------------------------------------------------------

(function() {
    data.approvers = [];
    // data.approvers = currentRecord.getDisplayValue();
    // var ritm = data.sys_id || $sp.getParameter('sys_id');
    //var ritmSysI
    var appr = new GlideRecord('sysapproval_approver');
    appr.addQuery('sysapproval', data.sys_id); // RITM sys_id
    // appr.addQuery('source_table', 'sc_req_item');
    appr.orderBy('state');
    appr.query();

    while (appr.next()) {
        data.approvers.push({
            name: appr.approver.getDisplayValue(),
            state: appr.state.getDisplayValue()
        });
    }
})();
----------------------------------------------------------------------------------------------
I can see the approver details on RITM request summary, but it is returning all approval details.
how to get the dynamic for current open RITM record. I know the query is not proper in above code.

@t venkatesh2 

seems you are not able to get the RITM sysId properly and hence it's giving all approvers

which widget did you clone?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 
Can you suggest how to get the current RITM approvers
widget name: sc_order_status

@t venkatesh2 

there try to get the REQ number and then find all RITMs linked to it and then get approvers for those RITMs

request_id -> holds REQ sysId

So you can enhance accordingly

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader