- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 08:48 PM
Hello,
I created a View name it as 'ITIL Custom View' which i need to set it as default all the ITIL Users on Incident table. Can anyone please help me out with this
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 10:21 PM
try this,
(function overrideView(view, is_list) {
if (gs.hasRole("itil")) {
answer = "ITIL_Custom_View";
return answer;
}
answer = "ess";
})(view, is_list);
Beth has ITIL role,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 09:02 PM
This should answer your query:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 09:35 PM
Shishir,
I already tried that below is the script which i written in view rules advanced column:
(function overrideView(view, is_list) {
// Add your code here
//Force non-itil users to use the ess view
if (gs.hasRole("itil"))
{return answer;}
if (view.startsWith("ess"))
{return;}
// do not change view if it starts with sys_ (e.g. sys_ref_list)
if (view.startsWith("sys_"))
{return;}
answer = "New V"; // set the new view to answer
//answer = null; // set the new view to answer
})(view, is_list);
Am i doing anything wrong, when i impersonate ITIL User i still see Default View

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 10:03 PM
(function overrideView(view, is_list) {
// Add your code here
//Force non-itil users to use the ess view
if (gs.hasRole("itil"))
{
answer = "New V";
return answer;
}
if (view.startsWith("ess"))
{return;}
// do not change view if it starts with sys_ (e.g. sys_ref_list)
if (view.startsWith("sys_"))
{return;}
//answer = "New V"; // set the new view to answer
//answer = null; // set the new view to answer
})(view, is_list);
This would return that view only if it is itil user. //View Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2018 10:10 PM
Thanks, I pasted your code when i impersonate i am getting null view 😞
I am getting for the users like ITIL, Admin role users