- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:17 AM
Hi folks,
I have the challenge that I need to restrict the selectable assignment groups for a specific Catalog item.
When a customer requests Item 'XYZ' from the Service Portal, the Fulfiller may only select Assignment Group A, B, and C in RITM and SCTASK.
I assume there is a way to realize with a script include but I do not know how to implement this.
Thanks for a little handy tip
Kevin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 01:10 AM
Hi,
Update your reference qualifier [Assignment group] condition like below..
Script Include
var GetGroups = Class.create();
GetGroups.prototype = Object.extendsObject(AbstractAjaxProcessor, {
GetGroupsBasedonItem: function(Item) {
if (Item == '04b7e94b4f7b4200086eeed18110c7fd') { //here provide your item name
var list = [];
var grp = new GlideRecord('sys_user_group');
grp.addEncodedQuery('name=App Engine Admins'); //which groups you want to show
grp.query();
while (grp.next()) {
list.push(grp.sys_id);
}
return 'sys_idIN' + list.join(',');
} else {
grp = new GlideRecord('sys_user_group');
grp.query();
while (grp.next()) {
list.push(grp.sys_id);
}
return 'sys_idIN' + list.join(',');
}
},
type: 'GetGroups'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:24 AM
Hi,
I didn't get this part -> customer requests Item 'XYZ' from the Service Portal
which form are you referring for this? is that assignment group a variable on your catalog item or you are talking about OOB field on RITM table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:26 AM
Hi Kevin,
You can control this with the help of advanced reference qualifier. write script include & add your logic for showing assignment groups "A,B,C" when "XYZ" catalog item is selected. call that script include in advanced referenced qualifier.
Regards,
Harshal.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:30 AM
Hi,
You can configure your group field in catalog as below.
Use the filter condition as per the need. Ex. you do not want to have the assignment group A to be visible the Name is not A condition can be used (Other then A all groups will be visible).
You can also use Advanced Reference Qualifier to call the script include and do further check in script.
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:38 AM
Hi,
In my assignment group field (dictionary entry) I have added a dictionary override.
In the reference qualifier I have added:
javascript:<SCRIPT INCLUDE>;
In the script include I did various queries which built and returned a reference qualifier query string for the table.assignment_group
So I'd work out what reference qualifier query string you need for the reference qualifier, build it in the script include and call that from the dictionary override.
hth,matt