- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2015 01:16 PM
I am using the following Business Rule Restrict Form Views by Role - ServiceNow Wiki to restrict users without the ITIL role, to globally be restricted to only views that are "ess".
The issue is that it is not working...
Looking through the script, the last function is calling the main function, but I do not see this last function actually being called anywhere in the script (function sys_user_listGetViewName()). Is this why it is not working?
Just would like to get some help troubleshooting this script, as I am testing with a user who has a single role that is not ITIL. and the view is still going to the default view instead of the ess view.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2015 09:43 AM
Though this rule is global, you have to make modifications for each table that you want to force the ESS view. This one is on the sys_user_list. So in demo013, i gave Zan Sulikowski the user_admin role so he can see users (no ITIL). Without the rule, he see default view. With rule, he see ESS view.
In the comments of the rule it says: //To use on other tables, replace sys_user with the table name
So for change request table you would change to:
function change_requestGetViewName() {
function change_request_listGetViewName() {
change_requestGetViewName();
and you've limited non-ITIL to ESS view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2016 08:10 AM
I just gave like this.
function sys_userGetViewName() {
if (gs.hasRole("itil"))
return;
if (view.startsWith("TestView"))
return;
if (view == "sys_ref_list")
return;
answer = "TestView";
}
function sys_user_listGetViewName() {
sys_userGetViewName();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2016 05:05 PM
Hi Michael,
Can you please give me the steps what exactly to be performed on SNow.
I want to restrict Seflservice view for the all the users who doesn't have 'admin' role.
Thanks in advance!
Regards,
RRR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 05:12 AM
On what table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2016 03:12 PM
what is i need to default the itil users to default view on incident table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2016 07:37 PM
I would try a view rule.