User criteria shows 'Item is unavailable for this user' error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I am trying to limit the view of a catalog item, with user criteria, only to users that are part of any group that is available in the first variable of the item (see the attached screenshot). For some users I get the error 'Item is unavailable for this user' and for the users that are part of some groups available in the reference qualifier, the item is not visible at all. I am using the same reference qualifier for the user criteria (see the code below) as for the group variable. The reference qualifier is only based on types of groups.
I have also changed the access_type to delegated based on a post I saw on the community but that doesn't seem to solve the issue.
(function() {
gs.info('##test1');
var gr = new GlideRecord('item_option_new');
gr.addQuery('sys_id', 'x');
gr._query();
var queryStr = '';
if(gr._next()) {
queryStr = gr.getValue('reference_qual_condition');
gs.info("##test2 " + queryStr);
}
var groups = [];
var grGroup = new GlideRecord('sys_user_group');
grGroup.addEncodedQuery(queryStr);
grGroup._query();
while (grGroup.next()) {
groups.push(grGroup.getUniqueValue());
}
return groups;
})();Could you please help me in solving this issue? Thank you!
