Get list of users who are in a User Criteria?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 08:40 AM
I need a good way to generate a list of users who fall into a particular user criteria. I know you can see the reverse of this, like see the different user criteria a user, or group, or location belongs to. Can anyone think of a good way to do this?
- 3,391 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 08:46 AM
Hi Steve,
If the Users are added directly to the User field of the User Criteria then you can report on it directly.
If the User criteria uses some script to check logged in User & then displays required items, articles, etc then there is no option as the script itself runs dyamically so getting the report for case where script controlls the criteria functioning will not be possible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2020 12:27 AM
Hi
Navigate to "> Service Catalog > Catalog Definitions > User Criteria" and set the below shown filter:
If you want to see which users are in any given User Criteria, you can just have a look at the "Users" Column of the List.
Let me know if that answers your question and mark my answer as correct & helpful, please.
Have fun & BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2020 12:35 AM
Hi
If you want to have a small code-snippet, which you can run in "Scripts - Backgroud" to list the users of each User Criteria, you can take the following as a starting point:
var ucGR = new GlideRecord('user_criteria');
ucGR.query();
while(ucGR.next()) {
gs.info('User Criteria "' + ucGR.getValue('name') + '"' + ' / Users in this User Criteria: "' + ucGR.getDisplayValue('user') + '"');
}
Let me know if that answers your question and mark my answer as correct & helpful.
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 01:55 AM
Hi
Do you have an update on this? Did you manage to solve your issue?
If yes, please mark the best answer as the correct one to close this thread.
Thanks & BR
Dirk