How to set an Iteration as Current Iteration programatically
I'm trying to set an Iteration as current iteration but it did not work, here is a code simple.
IIteration newIteration = (IIteration) IIteration.ITEM_TYPE.createItem(); IDevelopmentLine workingDevLine = (IDevelopmentLine) line.getWorkingCopy() ; workingDevLine.setCurrentIteration(newIteration); service.save(new IProcessItem[]{iter, newIteration}, monitor); Any idea? |
One answer
Hi Rachid,
From your code it does not look like you are saving the development line after setting the current iteration. You will need to save the dev line as well as the new iteration. Comments Hi Parker,
Sounds like you need to add the iteration to the dev line as well, try IDevelopmentLine#addIteration(IIterationHandle iteration) still same error message even after adding the iteration to DevelopmentLine. Any idea ?
If you read the documentation for IDevelopmentLine#addIteration it indicates that you also must call IIteration#setDevelopmentLine(IDevelopmentLineHandle developmentLine) on the iteration. Are you doing this?
Rachid Halloul
commented Sep 19 '12, 3:24 p.m.
here is the code sample workingDevLine.getWorkingCopy(); workingDevLine.setName(iter.getName()); newIteration.setDevelopmentLine(workingDevLine); workingDevLine.insertIterationAfter(newIteration, iter); iter.addChild(newIteration); workingDevLine.addIteration(newIteration); workingDevLine.setCurrentIteration(newIteration); service.save(new IProcessItem[]{newIteration,workingDevLine}, monitor); iter is the Release iteration (parrent) and the newIteration is the child,
Rachid Halloul
commented Sep 20 '12, 1:46 p.m.
Hi Parker, I was able to figure out the issue, I was not getting a working copy of the parent iteration. Thanks of your help.
showing 5 of 6
show 1 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.