- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 05:47 AM
For my Assignment Group fields (on the Standard Proposal Form) I'd like to only allow two Assignment Groups to be chosen (Change Management and Change Management Admin). I first tried to a Write ACL that only allowed Admin to write on the field. I also needed a Read ACL that allowed ITIL to read the field. This did not work as the ITIL users can still pick from the list and see all of the Assignment Groups.
I can't modify the dictionary definition on the field as it is the Assignment Group field off of the Task form and used throughout the Instance.
I do have a client script that auto-populates the field (On Load) with the Change Management Assignment Group, but I don't want anyone to be able to change it to anything but Change Management Admin.
Any thoughts on how I can restrict it to just the two groups?
thanks,
Richelle
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 09:30 AM
Thank you both for your suggestions. Here's what I ended up doing. I added a Dictionary Override to the Assignment Group field on the Standard Change Proposal form.
For that, I marked "Override Reference Qualifier" as True.
I then put this in for the Reference Qualifier: roles=change_manager
Those two assignment groups both have that role, so this worked for me. They both display now and none of the others do. Plus all of the others still display for the other task types.
Thanks,
Richelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 08:24 AM
I tried this, but it still showed all of the assignment groups. I also tried adding a ' to the end of it (as you had one at the beginning right after javascript:). That brought back no assignment groups. Just to be crazy, I also tried removing the ' you had in front of the script...that too brought back all of the assignment groups.
thanks,
Richelle

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 06:44 AM
Here's how we did it:
First, assign a "type" to the group:
Now, change the dictionary attribute of the "Assignment Group" field on the Task table to point to this business rule:
And here's the code for the Business Rule:
function TaskAssignmentFilter()
{
var classname = current.getRecordClassName();
var filter = "type=null";
if (classname == "u_human_resources")
{
var a = current.assigned_to;
// GetGroupFilter() will do a lookup on the group type display values.
filter = GetGroupFilter("hr");
if (!a)
{
return filter;
}
else
{
var gp = ' ';
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user', a);
grp.query();
while (grp.next())
{
if (gp.length > 0)
{
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else
{
gp = grp.group;
}
}
return (filter + '^sys_idIN' + gp);
}
}
else
return BackfillAssignmentGroup2();
return filter;
}
function BackfillAssignmentGroup2()
{
var gp = ' ';
var a = current.assigned_to;
var cat;
var filter;
//return everything if the assigned_to value is empty
if(!a)
{
cat = new GlideRecord("sys_user_group_type");
cat.addQuery("name", "catalog");
cat.addQuery("name", "hr");
cat.query();
filter = "type=null";
if (cat.next())
{
filter += "^ORtype!=" + cat.sys_id;
}
return filter;
}
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user', a);
grp.query();
while (grp.next())
{
if (gp.length > 0)
{
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else
{
gp = grp.group;
}
}
cat = new GlideRecord("sys_user_group_type");
cat.addQuery("name", "catalog");
cat.addQuery("name", "hr");
cat.query();
filter = "type=null";
if (cat.next())
{
filter += "^ORtype!=" + cat.sys_id;
}
// return Groups where assigned to is in those groups we use IN for lists
return (filter + '^sys_idIN' + gp);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 08:28 AM
Some questions about your script...
You add the dictionary attribute to the Assignment Group field on the (base) Task table and not the extended table?
In your script, where it says "if (classname == "u_human_resources")" is that referencing the table you want this to apply to?
I added a type of "change" to the two assignment groups, and this is on the std_change_proposal table.
thanks,
Richelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 09:30 AM
Thank you both for your suggestions. Here's what I ended up doing. I added a Dictionary Override to the Assignment Group field on the Standard Change Proposal form.
For that, I marked "Override Reference Qualifier" as True.
I then put this in for the Reference Qualifier: roles=change_manager
Those two assignment groups both have that role, so this worked for me. They both display now and none of the others do. Plus all of the others still display for the other task types.
Thanks,
Richelle

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 11:43 AM
Thanks for sharing. That's the best solution - when they both share a role and only that role! That's the exact same example I came up with for next week's show.