How to restrict View all Approvals in ServicePortal

samadam
Kilo Sage

I am trying to restrict Approvals on service portal header menu to only show approvals for certain task records. I modified the SP header menu but when clicking on Approval it shows View All Approvals which is still showing all approvals. View All Approvals have the following

var link = {};
link.title = gs.getMessage('View all approvals');
link.type = 'link';
link.href = '?id=approvals';
link.items = [];
t.items.push(link);

How can I add a condition to restrict by sys_class_name

5 REPLIES 5

J Siva
Tera Sage

Hi @samadam 
I've provided the soltuion for the similar requirement.
PFB the link.
https://www.servicenow.com/community/developer-forum/how-to-filter-only-sc-req-items-in-the-approval...

JSiva_0-1745490473001.png

 

Let me know if you have any queries.
Regards,
Siva

I did that already the count and drop down works but when View All Approvals is clicked it shows everything. 

@samadam Did you make changes to the approvals page?

Once you click view all approvals, it'll take you to the Approvals page.

There you can see OOB widget "approvals". You need to either update that widget or else take a copy and add the new widget to the Approvals page. I've shared the steps for the same in the below community post.

 

https://www.servicenow.com/community/developer-forum/how-to-filter-only-sc-req-items-in-the-approval...

 

Ankur Bawiskar
Tera Patron
Tera Patron

@samadam 

this link has the solution, please enhance

Restrict approval widget to show only RITMs/CRs approval on Service Portal 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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