Reference Qualifier for "sys_user_grmember" on Service Catalog Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 03:33 PM
How can I set up the reference qualifier so that only the members of the group "EUC-APCL-AHA" are visible on this reference field on Service Catalog form? With the current selection, its only showing the sys_id list of all the entries on "sys_user_grmember" table.
Any help is greatly appreciated. Thanks.
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 04:44 PM
To select a user (Assigned to) one ought to create a reference to User (sys_user), not Group Member (sys_user_grmember). You could possibly make it show user names by manipulating/configuring the display value of Group Member, but that would be a global setting ans still the wrong thing to do. The correct thing to do would be to make the reference point to User (sys_user) with a Script Include based reference qualifier that returned an encoded query that selects the correct users, or an encoded query based reference qualifier using a SUBQUERY term.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 04:53 PM
E.g. I have the setup below:
using Reference qualifier:
javascript: 'SUBQUERYsys_id,user,sys_user_grmember^group=' + current.variables.assignment_group + '^ENDSUBQUERY';
Whenever someone selects a group in the other variable - assignment_group, this variable displays just the members of the selected group.
It has the advantage that you have the possibility to display extra columns in the reference box making it easier to differentiate using with the same (display) name, but with different user ids and/or e-mails, by resorting to variable attributes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 05:04 PM
The solution in "action" after changing the encoded query to only return active members:
javascript: 'SUBQUERYsys_id,user,sys_user_grmember^group=' + current.variables.assignment_group + '^ENDSUBQUERY^active=true';
The group (selected in the Assignment group - other variable):
The user selection window:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 05:06 PM
You just need to modify the encoded query "generator" to not rely on another (group reference) variable but a hard coded group's sys_id:
javascript: 'SUBQUERYsys_id,user,sys_user_grmember^group=' + GetIDValue('sys_user_group', 'EUC-APCL-AHA') + '^ENDSUBQUERY^active=true';