User is not able to view assignment groups.

John Vo1
Tera Guru

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?

1 ACCEPTED SOLUTION

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...

find_real_file.png

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.

View solution in original post

39 REPLIES 39

Mark Stanger
Giga Sage

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,

 

Like this?

Mark,

 

I updated the script, but she's still unable to see assignment groups in case and incidents.

Just remove the '+ ","' at the end of your itil groups line.  Should work.

I did that and when I go into case assignment groups it shows 77 groups instead of the 9.