- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 02:38 AM
Hi All,
Requirement is to create a user criteria to add to Knowledge articles. The condition is : Users who have Direct reports under their profile (From Employee Center Portal)should be able to view those Knowledge articles. Need inputs to create that User Criteria.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 02:58 AM
Hi Achyuth Krishna,
Im guessing direct reports are the user who have the logged i user as the manager.
You can write script in user criteria and check if logged in user is manager of any user then return true.
var grUser = new GlideRecord('sys_user');
grUser.addQuery('manager',gs.getUserID());
grUser.query();
if(grUser.hasNext())
answer = true;
Add this user criteria to the article record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 02:58 AM
Hi Achyuth Krishna,
Im guessing direct reports are the user who have the logged i user as the manager.
You can write script in user criteria and check if logged in user is manager of any user then return true.
var grUser = new GlideRecord('sys_user');
grUser.addQuery('manager',gs.getUserID());
grUser.query();
if(grUser.hasNext())
answer = true;
Add this user criteria to the article record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2025 01:22 PM
This is super helpful for my question (here https://www.servicenow.com/community/employee-center-forum/employee-center-menu-item-show-only-to-pe...) as well!
I am wondering, though, if I do this in a Menu Item, will that slow down performance for my Employee Center if it has to do this script every time anyone loads the page?