Category/Subcategory to load based on user roles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2008 01:47 PM
I'm sure there's a way to do this, but can't figure it out...so here I am posting...
I'd like to have certain categories and subcategories on the incident form visible to specific users for routing purposes. Is there a way to set categories/subcategories to show based on user roles?
- Labels:
-
Orchestration (ITOM)
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2008 02:04 PM
You can do this using client scripting. Take a look at the following wiki article. There are examples there on how to check for a specific role and how to remove options from a choice list.
http://wiki.service-now.com/index.php?title=Client_Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2008 02:05 PM
Domain Separation would allow you to accomplish that. Obviously complicates things though in other areas though...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2008 02:05 PM
Mark
this may give you a start. It is a client script that will check if the user has role of admin or itil. The only issue is you have to then maintain a script as you update, but it would work. See if anyone has a cleaner way..
function onLoad() {
var isITIL = g_user.hasRole('itil');
var isAdmin = g_user.hasRole('admin');
if (isAdmin){ //return if admin and allow all fields
return true;
} else {
if (isITIL){ // if itil remove hardware
g_form.removeOption('category', 'hardware');
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2008 02:06 PM
Only with client script, I believe:
http://wiki.service-now.com/index.php?title=Client_Scripts#Test_if_the_current_user_has_a_role
http://wiki.service-now.com/index.php?title=Client_Scripts#Remove_an_Option_from_a_Choice_List
You'd test for a role, then add/remove choice list options based on the user's roles.
Easy for category, but for subcategory it might get tedious to script! Maybe someone else has a better solution.