ServicePortal-Display the delegate approval on approvals widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 08:09 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2017 01:22 AM
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!