- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:04 AM
Hello Experts,
I want to hide 'New' button on incident list view for all non-ITIL users. And I have configured the list control as below.
But, when impersonated as non - ITIL user, they can still see the 'New' button but when clicked they see this error.
Any input or suggestions to hide 'New' button for all 'Non - ITIL' users.
Thanks,
Rocky.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:33 AM
Take a look at this UI Action
instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=c9ce66b4d703120060faef637e610334
If a user doesn't have the ITIL role, it's trying to redirect them to the OOTB create incident record producer (line 14). My guess is you have the RP disabled and that's why they get the error message.
You can add an && condition to the condition field so the button only appears for ITIL - && gs.hasRole('itil,sn_incident_write')
(new GlideRecord(current.getTableName())).canCreate() && !RP.getListControl().isOmitNewButtonWithoutChecks() && !RP.isRelatedList() && gs.hasRole('itil,sn_incident_write')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:12 AM
Are you sure that the person you are impersonating doesn't have the itil role? They could've inherited the role through another role.
Check this link to search if they have the itil role
instanceName.service-now.com/sys_user_has_role_list.do?sysparm_query=role%3D282bf1fac6112285017366cb5f867469&sysparm_view=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:27 AM
Yes the user has only the custom role I created.
Thanks,
Rocky.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:33 AM
Take a look at this UI Action
instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=c9ce66b4d703120060faef637e610334
If a user doesn't have the ITIL role, it's trying to redirect them to the OOTB create incident record producer (line 14). My guess is you have the RP disabled and that's why they get the error message.
You can add an && condition to the condition field so the button only appears for ITIL - && gs.hasRole('itil,sn_incident_write')
(new GlideRecord(current.getTableName())).canCreate() && !RP.getListControl().isOmitNewButtonWithoutChecks() && !RP.isRelatedList() && gs.hasRole('itil,sn_incident_write')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:23 AM - edited 10-13-2022 06:23 AM
Hello,
I guess easiest way to do is to modify 'create' ACL on Incident table and include "ITIL" under roles, In my opinion this should be easiest solution but give a try.
Regards,
Musab