Advanced User Criteria for Catalog Item
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Trying to create an advance script for some catalog items to where it is available for users with customer Boolean field u_is_a_manage is true. It has yet to work for me. Is there something wrong with my script?
answer();
function answer(){
var manager = gs.getUser().getRecord().getValue('u_is_a_manager');
if (manager == 'true')
{return true;}
else
{return false;}
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @mgraden ,
answer();
function answer() {
var user = new GlideRecord('sys_user');
if (user.get(gs.getUserID())) {
return user.getValue('u_is_a_manager') == '1';
}
return false;
}
Test it by opening User record and make sure u_is_a_manager = true (checked). Now Impersonate that user and open Service Catalog and test.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
55m ago
