User criteria API

Aric3
Giga Expert

Hi Everyone,

I was hoping to utilize user criteria records for an upcoming project. I was surprised to find that there isn't an immediately obvious way to do this from a user-generated script.

What I'm looking for is essentially the GlideFilter.checkRecord() equivalent for user criteria.

I found a recent post to check catalog item availability, however I'm hoping there's a generalized version hidden away in the API somewhere.

Thanks,

Aric

1 ACCEPTED SOLUTION

Aric3
Giga Expert
9 REPLIES 9

Manjeet Singh
ServiceNow Employee
ServiceNow Employee

Hi Aric, If its a Service catalog item then try this code to evaluate user criteria GlideappCatalogItem.get('catalog item sys_id').canView();  


Hi Manjeet, thanks but is there a generalized way to evaluate the User Criteria? By this I mean to evaluate one without an attached Catalog Item - like if I was to relate user criteria to my own custom table that doesn't inherit from sc_cat_item?



It's just that it seems to be a quite useful system to leverage in custom systems & it's a shame not to be able to directly check if user criteria is met.


Hi Tim,



The user criteria concept is only available to Catalog or knowledgebase. Let me circle back with the dev team to see if there is a workaround to use it on custom tables.


Hi Manjeet,



That would be great! The reusability of user criteria in a simple configuration-based record makes administration really straight straightforward. This would be a great addition to the core platform API.



Thanks,


Aric