Restrict Assignment group for a specific item

Kevin Lübben
Tera Contributor

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

1 ACCEPTED SOLUTION

Raghu Ram Y
Kilo Sage

Hi,

Update your reference qualifier [Assignment group] condition like below.. 

find_real_file.png

 

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'
});

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Harshal Gawali
Giga Guru

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.

Sourabh26
Giga Guru

Hi,

 

You can configure your group field in catalog as below.

find_real_file.png

 

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

Matt102
Giga Guru

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