Service Desk Practitioners Forum
Showing results for 
Search instead for 
Did you mean: 

Java - query on multiple assigned workgroups?

Michael Tutty
Occasional Advisor

Java - query on multiple assigned workgroups?

Is there any way to specify a list of assigned workgroups for a ServiceCall query?
Tommy Koronen_1
Regular Collector

Re: Java - query on multiple assigned workgroups?


You can only query for one workgroup at a time.

One thing you can do is to create an java.util.ArrayList to collect the result from multiple queries.
Here's a sketch/idea on how you might do it:

ArrayList CallList = new ArrayList();
for (int g = 0; g < WorkGroups.length; o++) {
AssWhere = AssHome.createAssignmentWhere();
ScWhere = SCHome.createServicecallWhere();
SCs = sc_hm.findServicecall(ScWhere);
ServiceCalls = (IServicecall[])CallList.toArray(new IServicecall[0]);

(I've left out declarations etc, but I hope this helps anyway)

Michael Tutty
Occasional Advisor

Re: Java - query on multiple assigned workgroups?

Thanks for the response. That's what I'm currently doing, but for someone who's in many groups this will be pretty slow. Is this what the SD client does today, or is there a better way to get the tickets that a given user is associated with?
//Add this to "OnDomLoad" event