- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 10:38 AM
I have this BR that helps filters out assignment groups depending on the role. I have this one user that has both sn_customerservice_agent and itil role. But when I impersonate her I'm unable to pull any of the groups up under incidents and case. Can someone help?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 12:11 PM
Here is an example of how you could create an advanced reference qualifier for the 'Assignment group' field on the 'Case' table. You'll start with a script include.
Create a script include that looks just like this...
Here is the script you would use...
function getCaseGroups() {
var groupNames = "Accounts Receivable _ JIB, Revenue, Division Order, Payables, Regulatory, Production Reporting, Lease and Contracts Information, Land and Operations, SCOR Customer Care Center";
return groupNames;
}
Then right-click the 'Assignment group' field label on your 'Case' form and select 'Configure -> Dictionary'.
If your 'Case' table extends from the 'Task' table you'll need to create a dictionary override for the 'Case' table using the related list at the bottom of the dictionary form. You can check the 'Override reference qualifier' box and then supply the reference qualifier value in the 'Reference qualifier' field on the override. Here is the reference qualifier you would use...
javascript: 'nameIN' + getCaseGroups();
You can repeat this same process (changing function names, etc.) with another script include and dictionary override for the incident table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 10:52 AM
This is because both 'if' conditions are being hit...the first one hits and restricts the groups to those where the 'Name' is one of the values provided using the 'addQuery' line. Then the second one hits with an additional addQuery line (which acts like an 'AND' condition) and shows nothing.
Basically, the query you're constructing looks like this...
Group name is one of these...and group name is one of these...
You could add an else statement but then you end up only returning the first one all the time for the user with both roles.
What you need to do is only return a single 'addQuery' line with a single text string. Something like this...
var groupString = '';
if (gs.hasRole("sn_customerservice_agent") && !gs.hasRole("admin") && gs.isInteractive()) {
groupString += "ALL OF YOUR CUSTOMER SERVICE GROUP NAMES HERE";
}
if (gs.hasRole("itil") && !gs.hasRole("admin") && gs.isInteractive()) {
groupString += "ALL OF YOUR ITIL GROUP NAMES HERE" + ",";
}
// Only add a query if conditions were met
if (groupString.length > 0) {
current.addQuery("name", "IN", groupString);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 10:55 AM
Mark,
Like this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 11:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 11:10 AM
Just remove the '+ ","' at the end of your itil groups line. Should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 11:18 AM
I did that and when I go into case assignment groups it shows 77 groups instead of the 9.