How to Script a User Criteria Check

nullreturned
Kilo Guru

We're using the Service Desk Call application (Geneva), and the problem is that when the Call type is "Request", the entries under the "Request item" aren't filtered based off User Criteria.   I'm fine scripting the filtering out, but there are no references for this in Service Catalog.   I can model some things around the calls Knowledge v3 makes, but that falls short.   Anyone have any information around scripting for User Criteria checks?

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Damian,



The user criteria is really meant to determine whether the logged in users will see specific items and categories while browsing or searching the service catalog. If you want a head start on writing a script that does it I would take a look in the ui page com.glideapp.servicecatalog_cat_item_view.


View solution in original post

7 REPLIES 7

Hi,



Is there a way of doing this against KB (kb_knowledge_base) ?



I need to to return via query all KB that the logged in user is allowed to view.



Is there a similar way?



Thanks



Broderick


Hi Damian,



I am facing the same issue now. I want to restrict users to see the cat items according to user criteria In my custom self service portal which is coming through a dynamic page (jelly), but how do I exactly do it .if you Can brief it step by step..it will really be helpful.


If anyone sees this, I found one issue to be corrected with this code:



On line 22:


availableItems = catItem.sys_id;  


change this to be


availableItems += catItem.sys_id;  



I think the current code has issues because it is trying to append a string to something that was set as an object (catItem.sys_id)