Assigned to based on Assignment group and Vice Versa

aks4
Tera Contributor

So this customer has a requirement where they want to restrict Assignment group based on Assigned to Selection and Assigned to based on Assignment groups.

For example if a user is a member of 5 groups, then when his name is selected in Assigned to field, then those 5 groups should only be visible in Assignment Group field 

Similarly, if I select an Assignment group field then only members of that assigned to group should be visible in Assigned to fields.

Both of these use cases should exist in the system together.

Any thoughts on this requirement? 

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Showing assigned to based on assignment group should happen without script using dependent field

something like this on assigned_to field

find_real_file.png

Now based on assigned to show the groups to which that user belongs; you will have to add advanced ref qualifier on group field

javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups());

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I already have a advanced reference qualifier which needs to be there as it. So how is it possible to append this with the existing reference qualifier. 

 

nameISNOTEMPTY^typeNOT LIKE123a45ac6f7a890123456b7890123e4f^EQ

Hi,

like this

javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups()) + '^nameISNOTEMPTY^typeNOT LIKE123a45ac6f7a890123456b7890123e4f^EQ';

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

So all the assignment group disappears with this filter and concerned group is visible when we select a user in Assigned to. But the requirement is If a user wants to select assignment group then all the groups should be visible if assigned to is empty

and if the user fills up an assignment group, then only group members should present in assigned to

and if assignment group is not filled and assigned to is filled then only assignment groups associated with the assigned to should be visible.