How to get workitems planned for an iteration and sub iterations with Plain Java API ?
Hello,
I'm using Plain Java API to get the list of workitems planned for an iteration like this : https://jazz.net/forum/questions/139046/how-to-query-defects-for-a-secified-iteration-in-java-client
And it works well.
Now, I'm trying to modify this to get all workitems planned for this iteration and all the sub iterations.
I was thinking I just need to change the AttributeOperation "EQUALS" to another value like when I'm creating a query in the web interface changing "is" into "is part of".
Here is the line :
Expression expression = new AttributeExpression(attribute, AttributeOperation.EQUALS, curIteration);
But I can't find any usable value.
How could I do that ?
Thanks for your help !
3 answers
Here some hints on the API https://rsjazz.wordpress.com/2012/10/05/handling-iterations-automation-for-the-planned-for-attribute/
List<IIteration> SubIterations = getAllSubIterations(curIteration);
Term plannedfor= new Term(Term.Operator.OR);
plannedfor.add(expression);
for(IIteration i : SubIterations)
{
Expression expression_sub = new AttributeExpression(attributeCurrentIteration, AttributeOperation.EQUALS, i);
plannedfor.add(expression_sub);
}
List<IIteration> iterationList = new ArrayList<IIteration>();
IIterationHandle handles[] = iteration.getChildren();
for (IIterationHandle h : handles)
{
IIteration i = resolveIteration(h);
List<IIteration> subList = getAllSubIterations(i, display);
iterationList.addAll(subList);
iterationList.add(i);
}
return iterationList;
}
It works, so it's ok for me.