Advance reference qualifier

shivani18
Tera Contributor

ISSUE WITH ADVANCE REFERENCE QUALIFIER

 

Created Advanced Reference Qualifier in Catalog Item (with variables 'group' and 'assigned')

to fetch values of users only of selected group.

 

But this is not working

shivani18_0-1712108794953.png

shivani18_1-1712108830617.png

shivani18_2-1712108854128.png

Needed help to solve this.

 

 

1 ACCEPTED SOLUTION

@shivani18 Please modify the reference qualifier as follows.

 

Screenshot 2024-04-03 at 9.41.22 AM.png

replace assignment_group with group in your reference qualifier.

 

Regarding sys_id display, please make the following change in the Group Member table.

Screenshot 2024-04-03 at 9.43.06 AM.png

View solution in original post

7 REPLIES 7

@shivani18 I have sent a direct message to you. Please check your inbox.

SK Chand Basha
Giga Sage

Hi @shivani18 

You can refer to this below link 

Advanced Filtering of List Collector Variables - D... - ServiceNow Community

 

Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

Service_RNow
Mega Sage

Hi @shivani18 

User Advanced reference qualifier for the assignment group

  • Add the below script in the “Reference qual” field

javascript:new getAssignmentGroups().filterd(current);

  • And create a new Script include with name “getAssignmentGroups” and function “filterd”
  • var getAssignmentGroups= Class.create();

    getAssignmentGroups.prototype = {

        initialize: function() {

        },


    filterd: function(current)

    {

    var groups = [];

    var assigned_to= current.assigned_to;

    if(assigned_to!= '')

    {

    var gr = new GlideRecord('sys_user_grmember');

    gr.addQuery('user',assigned_to);

    gr.query();



    while(gr.next())

    {

    groups.push(gr.group);

    }

    }

    return 'sys_idIN' + groups;

    },

        type: 'getAssignmentGroups'

    };

Mark this Helpful and Correct !!. If this Helps you to understand. This will help both the community and me.