- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2023 09:37 PM
Hi All,
In the user criteria for catalog item, I have the make the catalog item available only for the users depending upon their Department and Business Unit. If their Department and BU contains IT then it should be available. How can I make this?
Thanks in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2023 09:52 PM
Hi,
You need to check for Department & Business unit of logged in user & can be something as below
answer = checkCondition();
function checkCondition() {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', gs.getUserID());
user.addEncodedQuery('department.nameLIKEIT^ORu_business_unit.nameLIKEIT'); //Replace Business unit & Deparment dicitonary name value accordingly
user.query();
if (user.next()) {
return true;
} else {
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2023 09:52 PM - edited 05-14-2023 09:52 PM
Hello,
Add logic in the user criteria script section as per your business logic .
Please mark my response as Correct / Helpful
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2023 09:52 PM
Hi,
You need to check for Department & Business unit of logged in user & can be something as below
answer = checkCondition();
function checkCondition() {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', gs.getUserID());
user.addEncodedQuery('department.nameLIKEIT^ORu_business_unit.nameLIKEIT'); //Replace Business unit & Deparment dicitonary name value accordingly
user.query();
if (user.next()) {
return true;
} else {
return false;
}
}