ServicePortal-Display the delegate approval on approvals widget

mohan91
Mega Expert

The approvals pending for the delegates are not displaying under approvals widget in service portal. I have tried to use the code from   getmyapprovals BR but am unable to achieve it.

Any help is appreciated.

5 REPLIES 5

adrianherdan
Kilo Expert

Hello Mohan,



I have managed to get this working by using some of the code in the scripted list in the menu.



Replace:


var gr = new GlideRecord('sysapproval_approver');


gr.setLimit(50);


var qc1 = gr.addQuery("state", "requested");


if (input)


  qc1.addOrCondition("sys_id", "IN", input.ids);




gr.addQuery("approver", gs.getUserID());


gr.orderBy("sys_created_on");


gr.query();



With


var u = getMyApprovals();


var gr = new GlideRecord('sysapproval_approver');


gr.addQuery("approver", u);


gr.addQuery("state", "requested");


gr.orderByDesc('sys_updated_on');


gr.setLimit(50);


gr.query();



Hope this helps!