How to get members of field "Assignment group" in the lookup of Assigned to field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 05:43 AM
I have one field "assignment group" of type list collector where i can select multiple groups in this field.
Now i have created one another field on the form named "Assigned to" and this field also is a type of list collector, and now here how can i make the changes so that i can see all the members of groups selcted in field "assignment group" only.
Please not above mentioned both the fields are list collector type not reference field
- Labels:
-
Connect

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 06:10 AM
You will need a reference qualifier for this, since your field types is list.
1. You can create a script include and call that in the reference qual for the Assigned to field
2. Pass the parameter as assignment groups field, which is list of sys_ids of groups
3. you can use those information to glide the sys_user_grmember table and get the sys_ids of the users who belongs to those groups, and return the list of sys_ids
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 06:52 AM
Hi
You need to create advance reference qualifier and call script include function. Example, create script include assignToUtils.
and write below function and call that in your advance reference qualifier.
example,
javascript: new assignToUtils.refqualassignedto(current);
function refqualassignedto(current){
var group = current.u_assignment_group_2.split(","); // your assignment group variable name
var user_array = [];
if(group!=''){
var getMembers = new GlideRecord('sys_user_grmember');
getMembers.addEncodedQuery('group.sys_idIN'+group);
getMembers.query();
while(getMembers.next())
{
user_array.push(getMembers.getValue('user'));
}
return 'sys_idIN' + user_array.toString();
}
}
If this helps you, please mark it as correct.
Thanks,
Pratik Malviya