Show more results as Catalog Item Variable for specific group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi,
I have a catalog item variable that references "cmdb_ci_business_app".
Now, I want that variable to only show results that:
1. Are Active
2. Have the status "In Production"
3. Managed By Group, which must be one of the groups the person is a member of
If the person is a member of a specific group, say "SpecialGroup", then point 3 can be omitted.
How can I easily achieve this? I've tried several solutions, but nothing works.
Thanks!
- Labels:
-
ITSM: General
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
You need to use an Advanced Reference Qualifier that calls a Script Include. The SI will use GlideRecord to query the referenced table to return records that meet 1. and 2., then for each record that meets 3, push the sys_id to an array. The return from the SI will be like 'sys_idIN' then the comma-separated joined array. There are many examples of this. Give it a shot and post your reference qualifier and script if you get stuck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thanks @Brad Bowman ,
I have already tried this once, but unfortiunately it didn't work properly.
Will try agai and post here script include and advanced reference qual.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
try this in advanced ref qualifier on that variable
-> ensure you replace your correct group name
-> ensure you replace : with : as there is a known issue when we reply in community it converts that character
javascript: var query = '';
if (gs.getUser().isMemberOf('SpecialGroup'))
query = 'active=true^install_status=1';
else {
var groupsArr = new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
query = 'active=true^install_status=1^managed_by_group.sys_idIN' + groupsArr.toString();
}
query;
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
