- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 11:35 AM
I've been searching the community and the wiki and I have seen several ways that people have said they've done this, but none of them are working for me.
Here is my scenario:
The request is for the review of an assignment group and will be sent to the assignment group manager for fulfillment. It is to be filled out by the ITSM management team.
A reference field is filled in with the Assignment Group name by the requester.
A client script populates the Assignment Group Description field and the Assignment Group Manager field. Easy as pie.
There is a field for the members of the assignment group, and one more for the CI's associated with this assignment group. I haven't gotten to the CI field yet, but I think it will work similarly to the assignment group members.
I know which table holds the membership information (sys_user_grmember), and I know that a script will provide the information, but I've seen a business rule, a script include, a client script and I think a UI policy floating around the community.
And none of them work for me. I'm not sure which one if them is the correct place to script this. And I'm not sure if the field on the form should be a reference field, or a wide single line text, or not even a field, just a message that shows up. Or a list collector...
Looking for clarity and assistance on this one... Thanks in advance.
Suzanne
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 12:25 PM
and yes , there was a typo
script :
function assignmentGroupUsers()
{
var group = current.variables.assignment_group;
var user_array = [];
var getMembers = new GlideRecord('sys_user_grmember');
getMembers.addQuery('group',group);
getMembers.query();
while(getMembers.next())
{
user_array.push(getMembers.getValue('user'));
}
return 'sys_idIN' + user_array.toString();
}
i have set up a demo for you ...
goto
https://demo002.service-now.com/login.do
username : admin
password : admin
catalog to check
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2014 10:46 AM
Kalai,
The script as shown returns all 216000 of our current configuration items.
Is it possible for you to do this in a sandbox so I can look at all the elements? That was really helpful before.
Thanks!
Suzanne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2014 11:17 AM
Sorry to thread hi-jack, but this is exactly what I am trying to accomplish with the assignment group and the assigned to variables. I've taken the script provided and updated the variable name to match my instance, but it does not seem to work. I can choose the assignment group variable, but when I do, there are no users listed. I have confirmed I can select the same assignment group within an Incident ticket and see the associated list of users to select from. I am working in Dublin (Build tag: glide-dublin-09-13-2013__patch0-hotfix8-02-04-2014).
Any suggestions are appreciated.
Thanks
Ron
Variable info is as follows:
Type: Lookup Select Box
Name: assignment_group1
Lookup from table: Group [sys_user_group]
Lookup value field: Name
Reference qual: u_group_type=Support^active=true
Include none: selected
Visible on: Bundles; Guides; Elsewhere
Type: Reference
Name: assigned_to1
Reference: Group Member [sys_user_grmember]
Reference qual: javascript:assignmentGroupUsers()
Visible on: Bundles; Guides; Elsewhere
Script Include as follows:
function assignmentGroupUsers()
{
var group = current.variables.assignment_group1;
var user_array = [];
var getMembers = new GlideRecord('sys_user_grmember');
getMembers.addQuery('group',group);
getMembers.query();
while(getMembers.next())
{
user_array.push(getMembers.getValue('user'));
}
return 'sys_idIN' + user_array.toString();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2014 11:21 AM
Change the lookup value field to sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2014 11:49 AM
I appreciate the quick response.
Changed the Lookup value field from Name to Sys ID on the assignment_group1 variable, as suggested.
It didn't work either and the challenge is the requester filling out the form can't see the assignment group name, but rather the sys_id.