How to get workitems planned for an iteration and sub iterations with Plain Java API ?
![]() Hello,
|
3 answers
![]()
Ralph Schoon (62.0k●3●36●43)
| answered Oct 10 '18, 10:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Here some hints on the API https://rsjazz.wordpress.com/2012/10/05/handling-iterations-automation-for-the-planned-for-attribute/
https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ explains how to set values. You will have to pass an iteration handle to the planned for attribute.
|
![]()
I didn't find this kind of option, so I made it manually.
Before I had :
Expression inCurrentIteration = new AttributeExpression(attributeCurrentIteration, AttributeOperation.EQUALS, curIteration);
Now I have :
Expression expression = new AttributeExpression(attributeCurrentIteration, AttributeOperation.EQUALS, curIteration);
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); }
I created a function to get all the subIterations like this :
public List<IIteration> getAllSubIterations(IIteration iteration) throws TeamRepositoryException, IOException {
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. |