- 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-13-2014 11:55 AM
these are the fields on the table or variables on a catalog item or record producer?
if these are fields, just point the field to sys_user table and give the dependent field value as the field name of assignment group...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 12:04 PM
These are variables on a catalog item.
I wish they were fields on a table… ☺
Suzanne Ryan | Desk 818.887.8435 | Cell 818.974.1350 | Enterprise Service Desk 877.285.0550

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 12:08 PM
try this.. haven't tested it yet...
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('users'));
}
return 'sys_idIN' + user_array.toString();
//change the variablename in the first line accordingly and call this in the reference qualifier of the assigned to variable....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2014 12:08 PM
have written it on fly , so check for typos if any