- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 07:27 AM
We would like to test against User Criteria definitions in the condition of a business rule, UI action, client script, etc.
Is there a way to script to test against User Criteria definitions and return true or false?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 07:32 AM
Hi Robert,
There is a class/method to use to tell you which criteria apply. I have not yet figured out a way to evaluate each of those. Do some experimenting - i'm curious to know more.
SNC.UserCriteriaLoader.getAllUserCriteria()
Returns an array of sys_ids of the user criteria available to you. (applies to user's current login session.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2017 07:59 AM
Thanks for the response Chuck. Here's a simple use case I think should explain:
If the user in the field "Caller" on an incident matches a certain User Criteria record I want to perform an action such as increase Escalation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 06:12 AM
You are probably going to have to write a script of your own to get that specific. As far as I know, the User Criteria functionality checks the currently logged in user only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 06:31 AM
Thank you Chuck. You have been very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 08:02 AM
Were you able to solve this? I'm having trouble doing a user criteria check for the caller on the incident form via client script. I would like an alert to display.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 09:18 AM
UserCriteriaLoader.getAllUserCriteria() method is a deprecated method and we advice using userMatches() instead.
☞ Please refer to this article below, which explains on this in detailed.
https://www.servicenow.com/community/now-platform-blog/a-deep-dive-to-user-criteria/ba-p/2281285
Below are additional Knowledge articles which discusses Semaphore Exhaustion caused by the getAllUserCriteria function being called in widgets:
Semaphore Exhaustion is caused due to the getAllUserCriteria function getting called in widgets
Semaphores keep getting stuck and cause slow performance due to UserCriteriaLoader.getAllUserCriteri...