
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 12:57 AM
I have a request from my manager to get the assignment group for incident to only show the assignment group's parent assignment group for certain roles.
I have a script include:
function myGroupFilter() {
if (gr.userHasRole('itil_limited'))
return 'assignment_group=' + current.assignment_group.parent;
if (gr.userHasRole('itil'))
return;
}
But obviously this is not working.. help please. (also do i make the script include client callable or not)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 09:34 AM
When you are building a reference qualifier, you are actually filtering the list based upon the fields in the referenced table. From what I can see you are using 'assignment_group=' + current.assignment_group.parent
Since the Assignment group [assignment_group] field does not exist in the Group table, your reference qualifier will fail. See if you can create the filter you desire on the Group table first to see if you can build the filter from fields that exist in the table you are referencing.
You may want to consider only showing those groups which are parents and do not have parents of their own. I can see where a user picks a parent assignment group, then cannot pick anything else after that (even itself).
Something else to consider is what happens when the vendor decides to clear the assignment group field. There is nothing for your reference qualifier to get the parent of, so it will fail here too.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 09:34 AM
When you are building a reference qualifier, you are actually filtering the list based upon the fields in the referenced table. From what I can see you are using 'assignment_group=' + current.assignment_group.parent
Since the Assignment group [assignment_group] field does not exist in the Group table, your reference qualifier will fail. See if you can create the filter you desire on the Group table first to see if you can build the filter from fields that exist in the table you are referencing.
You may want to consider only showing those groups which are parents and do not have parents of their own. I can see where a user picks a parent assignment group, then cannot pick anything else after that (even itself).
Something else to consider is what happens when the vendor decides to clear the assignment group field. There is nothing for your reference qualifier to get the parent of, so it will fail here too.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 10:14 AM
Yeah I'll just stick with the UI action and Client script to change the field to read-only, both based on role... I think thats the best way, and its super simple.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 10:17 AM
By the way, in our case, assignment group is mandatory, and once they change the group, a user with a different role will handle it so being able to change it once would be fine, but I think its too difficult to make it.