Assignment group filter based on "Vendors" of Groups

mankare_smita
Giga Contributor

I have below requirement:

The assignment group on incident form should show only those groups which have logged in user's company in their "Vendors" field

For Example : Logged-in User's company is - Company1

there are three groups - Group1(vendors - Company1,Company2) , Group2 (vendors - Company1) , Group3 (vendors - company3)

Now when the logged in user goes to incident form and clicks on Assignment group,it should show only two groups - Group1 and Group2

14 REPLIES 14

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI SMita,



We have to write a reference qualifier and script include which will be called in reference qualifier.



Let me know if you want script.



Thanks,


SanjivMeher
Kilo Patron
Kilo Patron

You can write a script include and call it using advance qualifier.



var id = '';


var grp = new GlideRecord('sys_user_group');


grp.addQuery('vendor','CONTAINS',javascript:gs.getUser().getCompanyID());


grp.query();



while (grp.next())


{


        if (id!='')


                  id = id+','+grp.sys_id;


        else


                  id = grp.sys_id;


}



return 'sys_idIN'+id;



Please mark this response as correct or helpful if it assisted you with your question.

Script wrote this way:


find_real_file.png




Reference qualifier   :     javascript : new getGroupsVendors().getVendors();


Dont make it client callable. Also correct this line to grp.addQuery('vendor','CONTAINS',gs.getUser().getCompanyID());



Please mark this response as correct or helpful if it assisted you with your question.