- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 01:07 AM
I have a requirement to allow only managers and Tl to access and raise request
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 02:30 AM
try this
// check if logged in user has u_manager_type not as empty and value is not NON
var grSysUser = new GlideRecord('sys_user');
grSysUser.addQuery('sys_id', user_id);
grSysUser.addEncodedQuery("u_manager_typeISNOTEMPTY^u_manager_type!=NON");
grSysUser.query();
answer = grSysUser.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 01:13 AM
Hi @avinashdubey103,
You need to create User Criteria with conditions and apply it to Catalog item.
Apply user criteria to items and categories
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 01:22 AM
you should use User Criteria.
Did you start the script for that?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 01:49 AM
hi , started the script :but not able to understand how set the user :
Code:
var grSysUser = new GlideRecord('sys_user');
grSysUser.addEncodedQuery("u_manager_typeISNOTEMPTY^u_manager_type!=NON");
grSysUser.query();
while (grSysUser.next()) {
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 02:30 AM
try this
// check if logged in user has u_manager_type not as empty and value is not NON
var grSysUser = new GlideRecord('sys_user');
grSysUser.addQuery('sys_id', user_id);
grSysUser.addEncodedQuery("u_manager_typeISNOTEMPTY^u_manager_type!=NON");
grSysUser.query();
answer = grSysUser.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader