Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Why does my UI action work for admin, but not for itil user?

Community Alums
Not applicable

monikagoyal_0-1750962456920.png

I have created UI action for button functionality in release task (rm_task) table

UI action is not working for itil role ,i have checked acl their is no acl restricted for itil role.

1 ACCEPTED SOLUTION

SD_Chandan
Kilo Sage

Review the UI Action condition and client script logic to ensure it doesn’t exclude ITIL users.
Try with this code 
(current.assigned_to == gs.getUserID() || gs.hasRole('itil')) && current.state == //as per requirement;

or
Even if the UI Action is visible, the action might fail silently if the user doesn’t have permission to perform the operation (like update/delete).
Check points

Field-level ACLs for state

Check ACLs on the table the UI Action interacts with.

Make sure ITIL users have the required permissions (read/write/delete).


Thank you
Chandan

View solution in original post

3 REPLIES 3

BrianProvencher
Giga Guru

Is there a condition on the UI action?

pavani_paluri
Tera Guru
Tera Guru

Hi Monika,

Could you Please try validate the below things:

 

1.Visibility Rules on Form
Even if the UI action is correct, Form Layout or UI Policy/Client Script could be hiding it for itil users.

Try logging in as itil and use Ctrl+Right Click > Personalize > UI Actions to see if it’s hidden.

Check for any UI Policies or Client Scripts that may hide buttons.

2. Table Inheritance/Extension
Ensure the UI action is applied to the correct table. If your UI action is defined on rm_task, and your task is on a child table (e.g., release_task), make sure “Show insert” and “Show update” are set correctly, or move the UI Action to the specific table if needed.
3. Debugging
Add gs.info("UI Action triggered"); in server script or a console.log in client script to see if the code executes.
Use g_user.hasRole() in scripts to debug role logic:

if (!g_user.hasRole('itil')) {
console.log('User does not have itil role');
}
4. Role Inheritance
Sometimes itil users are behind an impersonation or custom role. Validate using the User Role table (sys_user_has_role) whether the user actually has the itil role.

 

Let me know if any of the debugging helped you to fix the issue.

 

Thanks,

Pavani.

 

SD_Chandan
Kilo Sage

Review the UI Action condition and client script logic to ensure it doesn’t exclude ITIL users.
Try with this code 
(current.assigned_to == gs.getUserID() || gs.hasRole('itil')) && current.state == //as per requirement;

or
Even if the UI Action is visible, the action might fail silently if the user doesn’t have permission to perform the operation (like update/delete).
Check points

Field-level ACLs for state

Check ACLs on the table the UI Action interacts with.

Make sure ITIL users have the required permissions (read/write/delete).


Thank you
Chandan