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

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

Hi, I Hope my solution helps you, if it helps please mark my response as correct and helpful so that it will be helpful for the future readers