How to get users having only ITIL role but not admin role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 07:18 AM
How do I get users who have only ITIL role but not any other role like admin role?
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 07:44 AM
Hi,
If you could explain a bit more, that'd be great...
Not sure what you mean by "how do I get" and then what are you doing with them?
Otherwise, like what's happening here, we provide responses and then you have to ask follow-on questions.
Let us know what you'd like to do like:
I would like to find all users within my instance that have ITIL role, because I want to add them all to 'x' group...
Then we can help more specifically and efficiently.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 07:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 09:59 AM
Hi...
You can simply create a test user with ITIL role? That's usually pretty standard?
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 07:54 AM
Hi Ajay,
You can simply get a report created on User Roles (sys_user_has_role) table & do a Group by: Role to get the count. Additionally, if you are looking for script try something as below in background script.
var roleis;
var rolecount;
var count = new GlideAggregate('sys_user_has_role');
count.addEncodedQuery('role=282bf1fac6112285017366cb5f867469^ORrole=2831a114c611228501d4ea6c309d626d'); //Comment this line if required to see difference in result as it would give you result of itil & admin
count.addAggregate('COUNT','role');
count.query();
while(count.next()){
roleis= count.role;
rolecount= count.getAggregate('COUNT','role');
gs.print("There are currently "+ rolecount+" users with a role of "+ roleis.getDisplayValue());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 08:29 AM
