- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 02:49 PM
Hi All!
I would like to create an Advanced User Criteria for use in Catalog Items that is restricted to users who have been allocated a specific Software License Entitlement. We have a few SaaS solutions that require users to be licensed and we want to create Catalog Items that allow existing users to request additional access within the SaaS solutions. We need to limit the availability of that Catalog Item to users who have the appropriate license.
Thanks!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 03:01 PM
Hi,
Did you have a specific piece of all this you needed help with? Sorry, I didn't quite understand from your post if you're saying you're stuck on like step 1 or you've tried x,y,z, but are stuck here...etc. Right now, your post is just a requirement, but we'd like to see what you've done/tried thus far.
To begin from my end, here is the documentation for how to create user criteria for the service catalog: https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/service-catalog-man... -- from there, you can query the respective table involved with your license entitlement and look for one assigned to that specific user, if found return true (which means pass) otherwise return false (which means they don't pass).
Example script is like:
answer = checkCondition();
function checkCondition() {
var usr = new GlideRecord('entitlement_table_here');
usr.addQuery('user_field_to_use_for_query',user_id);
usr.query();
return usr.hasNext();
}
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
02-23-2024 03:01 PM
Hi,
Did you have a specific piece of all this you needed help with? Sorry, I didn't quite understand from your post if you're saying you're stuck on like step 1 or you've tried x,y,z, but are stuck here...etc. Right now, your post is just a requirement, but we'd like to see what you've done/tried thus far.
To begin from my end, here is the documentation for how to create user criteria for the service catalog: https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/service-catalog-man... -- from there, you can query the respective table involved with your license entitlement and look for one assigned to that specific user, if found return true (which means pass) otherwise return false (which means they don't pass).
Example script is like:
answer = checkCondition();
function checkCondition() {
var usr = new GlideRecord('entitlement_table_here');
usr.addQuery('user_field_to_use_for_query',user_id);
usr.query();
return usr.hasNext();
}
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
02-26-2024 04:18 PM
Thank you Allen! I was finally able to get what I wanted working with this script as a base. I think I was trying too many things in too short a time period and was fighting against indexing/browser cache.
To clarify, I wanted this user criteria to source from our User Allocations table (alm_entitlement_user) where the allocated software entitlement (licensed_by) was a specific entitlement. It ended up looking like this:
answer = checkCondition();
function checkCondition() {
var usr = new GlideRecord('alm_entitlement_user');
usr.addQuery('licensed_by', '1e1eb639db6f451868236a19139619e2');
usr.addQuery('assigned_to',user_id);
usr.query();
return usr.hasNext();
}