Service Catalog Variable To Get Group Members
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2009 09:06 AM
In the Service Catalog we need to be able to select a group as a variable and then select an individual that is a member of the group. This will be the individual that is assigned to the catalog task. Unfortunately the catalog reference field does not have the dependent field that is available on a form reference field so you can make the list of users dependent upon the selected group.
I have been working with two reference fields. One to sys_user_group to get a list of groups and the other to sys_user_grmember to get a list of the members of the group. I have created a function in a business rule that is called by the sys_user_grmember variable. It is returning the correct records from sys_user_grmember but it will only display the sys_id of the sys_user_grmember records. I have not been able to get the returned list to display or be selectable by user name.
Has anyone set up something where you can select a group in a reference field and then return a list of the members of the group and then select a member of the group as a variable? If someone has accomplished this I would appreciate you help in getting this to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2009 02:51 AM
Hi Folks
I'm trying to figure out hwo to use the information found here to restrict the choices of a reference field in a service catalog variable. The field is referring to the sys_user table and I want restrict the possible selections to the members of a given group (HR Team).
Any help is mostly welcome !
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2010 06:14 AM
I know this is a little late and you may have already found your solution but if you want to filter the selections on a your reference field you can do it like this.
Do a "Personalize Dictionary" on your reference field on the form and add a "Reference qual" of something like "sys_user_group=HR Team" (just make sure the group name you put is the actual group name).
New customer so sorry it's a little late.
Jay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 11:47 AM
Hi, I tried this solution but when i perform a lookup on the Assign to field (sys_user_grmember) the system does not list any data, also is there a way where I can display the Name rather than the Sys Id in the list
Table: Global
function get_group_members(){
var answer = ' ';
var group = current.variables.variable_name_for_group_reference;
var get_group_members = new GlideRecord('sys_user_grmember');
get_group_members.addQuery('group',group);
get_group_members.query();
while(get_group_members.next()){
answer.push(get_group_members.user.toString());
}
return 'sys_idIN' + answer.join();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 01:05 PM
this wiki has a walkthrough on it btw
http://wiki.servicenow.com/index.php?title=Adding_Dependent_Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 02:42 PM
This example seems to be specific to Choice fields but I am not able to use it for reference fields. Is there a way to set filter on the Assigned to field to to show users that are part of the Assignment group. Similar to how Assignment Group and Assigned to work on Incident
Thanks in advance, Jay