How to put a sys_user role filter to the results of Approval Edit button?

Akshatha Balla1
Tera Contributor

Hi,

I need a user filtering for the selection of approvers from the RITM Approver Related List. I am able to get the filtering for the users having only itil role and not admin as approvers using the below methods:

  1. On the Approver list, right-click-->configure--> List Control--> Put the filter needed under Edit Default FilterAkshathaBalla1_0-1676224205752.png

     

  2. By applying the same query condition on the UI Action of Edit button on the Approval Table. 

AkshathaBalla1_1-1676224283438.png

 

 

uri.set('sysparm_query', 'roles=itil^roles!=admin');
action.setRedirectURL(uri.toString('sys_m2m_template.do'));

 

 

 

I get the needed filtering of users as an 'Admin' using either or both of these methods but only as an admin. When I click the Edit button as an itil user, I do not see the whole list. Somehow the roles gets converted to keywords for an itil user and renders incomplete or empty list.

 

Impersonation of an itil user

AkshathaBalla1_2-1676224469600.png

 

What am I missing here? I need all users to be able to see the same list of users that an admin can see. But for an itil user, even though they can see the list of users outside the edit button, the selection only shows limited uers.

 

 

 

 

3 REPLIES 3

4b0d3
Giga Guru

OOB edit button on approvals table:

4b0d3_0-1676261793704.png

pasted in your script: 

4b0d3_1-1676261903621.png

refreshed the sc_req_item record page and clicked edit:

4b0d3_2-1676261931918.png

 

Did you try the same as an itil user? It works fine for me as an admin but just not for an itil user. It replaces the roles with keyword (as shown in the screenshot) and gives incomplete filter result.

Akshatha Balla1
Tera Contributor

I later learned this is a known error in ServiceNow and there is no version for the Intended Fix

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694041

 

The way I've hacked around it is to create a Read ACL for itil users for the field Roles on sys_user table