'View Rule' not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2018 06:08 AM
Hi,
My issue is that I am not able to get the 'view rules' working for incidents.I have done a small script in the 'advanced' section of the view rules:
The system is only enforcing default view .I have split the users into 2 groups based on roles: itil and INV. I want 2 different views of the incident form for the two of them.but it always shows the default view

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2018 08:00 AM
Try this...
// populate the default value for the caller
function incidentGetViewName() {
if (gs.hasRole("INV")) {
answer = "YOUR_ROLE_NAME_HERE";
return answer;
}
if (gs.hasRole("itil"))
return;
if (view.startsWith("ess"))
return;
if (view == "sys_ref_list")
return;
answer = "ess";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 05:23 AM
Hi mark,
Thank you for your reply.I used this script. It gave the 'new' view of the incident form to all the users

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2018 06:25 PM
Sorry, this should ask for your view name in the 'answer' variable, not the role name.
// populate the default value for the caller
function incidentGetViewName() {
if (gs.hasRole("INV")) {
answer = "YOUR_VIEW_NAME_HERE";
return answer;
}
if (gs.hasRole("itil"))
return;
if (view.startsWith("ess"))
return;
if (view == "sys_ref_list")
return;
answer = "ess";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2019 06:02 AM
Hi, Do you know if that happened also for the sc_req_item? it is not working the view rule with the sc_req_item!