View Rule forces one role to a specific view and also the Admin role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 06:58 AM
We have a very basic View Rule set up. It is suppose to force our Support Center staff to a specific view of the Incident form and also the User Profile.
It is also forcing the Admin role the same way. I have been told this is as designed. It makes troubleshooting issues for non-support center staff very difficult. The rule is from 2016. I have read the docs and I don't see anywhere where it includes the Admin role in the rule. Has anyone else experienced this and is there a work around. It stops the Admin role from seeing the View Selector completely.
On an Incident form, I see this:
I see no View Selector on the Incident form
On a Work Order, I see the View Selector:
Any ideas, suggestions?
We are on Vancouver
#ITSM #ViewRule

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 06:44 AM
The g_user.hasRole() method is slightly tricky, because it returns true if the logged in use has the specified role OR the admin role. In this case, you'd want to use g_user.hasRoleExactly(). Here is a pretty good article on it: https://www.servicenow.com/community/itsm-articles/uses-of-hasrole-methods-client-and-server-side/ta...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2025 06:25 PM
This video has a good example of handling multiple view/role groupings within one scripted view rule. https://www.youtube.com/watch?v=PcqiNtHFOFk&t=1s