It's all about the answers!

Ask a question

moving or Deleting an iteration

Andy Berner (61127) | asked Jul 26 '11, 4:41 p.m.
Can someone confirm how to (a) move an iteration from one timeline to another and (b) delete an iteration outright, and (c) tell me the code to archive an iteration?

This is what I found experimentally, but I don't know all the rules, so please correct anything that's wrong:

a) To move iterationI from devLineA to devLineB:

IIteration iterationCopy =

IDevelopmentLine devLineBCopy =

IDDevelopmentLine devLineACopy =

IProcessItem[] itemsToSave =
new IProcessItem[]{devLineACopy, devLineBCopy, iterationCopy};
IProcessItem[] savedItems =, new NullProgressMonitor());

The important thing is to set the iteration to point to the new development line before deleting it from the original dev line.

If you don't delete the iteration from the list of owned iterations of devLineA, you cannot save devLineA, because it thinks it has an iteration that doesn't actually point to it.

b) To delete iterationI:

IDevelopmentLineHandle iterDevLine = iterationI.getDevelopmentLine();
//convert handle to a development line however you choose
IDevelopmentLine dl =
(IDevelopmentLine) (itemManager.getSharedItemIfKnown(iterDevLine));
IDDevelopmentLine devLineCopy =
IProcessItem[] itemsToSave = new IProcessItem[]{devLineCopy};
IProcessItem[] savedItems =, new NullProgressMonitor());

If I'm right, then IDevelopmentLine::removeIteration(IIteration iter) behaves differently depending on whether iter.getDevelopmentLine is the dev line you're deleting the iteration from. If it is, it deletes the iteration itself. If it isn't, it just deletes the iteration from the list of children the dev line thinks it has, as in the "move" code.

c) How do you archive an iteration without deleting it? There's a boolean to check if it's archived, but how do you set that?

One answer

permanent link
Parker Dunton (4064) | answered Jul 27 '11, 1:05 p.m.
Hi Andy,

In answer to c), IProcessItemService has a archiveProcessItem method that you can use.

Parker Dunton
Jazz Foundation | Process team

Your answer

Register or to post your answer.