Override Reference Qualifier questions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 11:03 AM
A while back I created a Dictionary Override for our Assignment Group field that used a Script Include to hide 2 groups from most of the other groups in our org. Here is my current Override set up:
I would like to add another Script Include to the Reference Qualifier field, but every time I do, I get incorrect functionality, and break my currently working set up. It doesn't seem to let me create a second Incident table Dictionary Override for the Assignment Group field, and I get this error: "java.sql.BatchUpdateException: (conn=2456722) Duplicate entry 'incident-assignment_group' for key 'name' ", so I would like to know how I can either add my second Script Include I need for the field, or what I need to do to add it to my currently working script include to make it work.
Here is the scenario to assist in what I need.
In the current script include, I have if the logged in user isn't in a certain 3 groups, they can't see 2 specific groups:
One of those original 3 groups is my Service Desk Managers group. I created another group recently that I need hidden as an assignment group from all other groups except Service Desk Managers, so I created a Script Include that looks like this:
When trying to add the Script Include to the Reference Qualifier field in the Dictionary Override form, I copied the format I had used previously, like so:
and it breaks what I have already created and works. I tried having the field read "javascript: isGroupABC(); isGroupService_Desk_Managers();" but that didn't work either. [EDITED by ServiceNow to "fix" the invalid HTML inside the quotes]
I also edited my original Script include isGroupABC to this:
but this also seems to break what was already working.
What am I supposed to be doing to make this work? I've at least added code to my original Script Include that makes it so nobody can see the new group unless you are in the 3 groups not excluded, but I want to exclude two of them from seeing this new group as well.
Any help would be greatly appreciated, thank you!
- Labels:
-
Agent Workspace
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 11:25 AM
Hello,
Just write one script include with the below format:-
if(user.memberof(servicedesk))
{
return default filter
}
else if(user.memberof(group2) || user.memberof(group3))
{
return sysid!-= write the one grp sysid which is only visible for servicedesk
}
else
{
retun sysid!= wirte all the four groups
}
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2022 04:54 PM
When I get a chance, I'll update my old script to this new one and see if it works. Then I'll let you know.
Thank you for your reply!