How can I make catalogue item visible to certain user?

Community Alums
Not applicable

I want 1 HR user to see the catalog item in Service Portal, how can i make that possible using script in User Criteria.

2 REPLIES 2

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Community Alums Refer this community threads

https://www.servicenow.com/community/itsm-forum/how-to-restrict-catalog-item-for-user-country/m-p/715951

https://www.servicenow.com/community/itsm-blog/scripts-in-user-criteria/ba-p/2294597 

You can write a script like below

var user = new GlideRecord("sys_user");
//Change filter according to yours variable names
user.addEncodedQuery("employee_typeSTARTSWITHEmployee^active=true");
user.query();
while(user.next()){
answer=true;
}