Populate assign to based on activity team

Anna_Servicenow
Tera Guru

I have to override the reference qualifier of 'assigned to' for one of the child table of task. 
The assigned to should show only active users that are part of assignment group selected . How to achieve this? 

5 REPLIES 5

Aranya
Tera Guru

Hi Anna,
For this purpose we use something called a "Dictionary Override".
Navigate to the child table and open the dictionary of the "assigned to"field. There go to the related list marked as "Dictionary Override".

Aranya_0-1724941299738.png

Now if already present, open the dictionary override record (if absent create a new one) for the child table and select "Override Reference Qualifier". For demonstration purpose, I have used the "Incident" table. Put the reference qualifier as this:

Aranya_1-1724941406248.png

Now here you are calling a script include named getUsersofAGRoup which is used to determine the sys ids of the active users of the current assignment group. Your Script Include should look something like this:

Aranya_2-1724941502444.png

For better viewing, here's the code:

 

var getUsersofAGRoup = Class.create();
getUsersofAGRoup.prototype = {
    initialize: function() {},
    getUsersofGroup: function(asmtgroup) {
        var groupUserSysIds = [];

        var groupUsers = new GlideRecord('sys_user_grmember');
        groupUsers.addEncodedQuery('group=' + asmtgroup + '^user.active=true')
        groupUsers.query();
        while (groupUsers.next()) {
            groupUserSysIds.push(groupUsers.user.toString());
        }
		
        return 'sys_idIN' + groupUserSysIds;
    },


    type: 'getUsersofAGRoup'
};

 

 Once you configure this, you would be able to see your configuration working as expected.
Thanks.
Please mark as Helpful and if this worked for you kindly mark this reply as the Solution!