How to collect no. of users who have ITIL or Admin role in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:07 AM
How to collect no. of users who have ITIL or Admin role in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:27 AM
That would work.
UPDATE 1:
If you add an OR-condition to handle the admin role as well of course.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:29 AM
Hi Bijender,
yes it will show correct number of user with "ITIL" role.
Regards,
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 05:23 AM
if you need script here you go. i tested and it's working
count=0;
var grUserRoles = new GlideRecord('sys_user_has_role');
grUserRoles.addQuery('role', '282bf1fac6112285017366cb5f867469'); // itil
grUserRoles.query();
while(grUserRoles.next()) {
count++
gs.print(grUserRoles.getDisplayValue('user'));
}
gs.print(count);
you can run into background script .