Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

moving or Deleting an iteration

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 =
(IIteration)processItemService.getMutableCopy(iterationI);
iterationCopy.setDevelopmentLine(devLineB);

IDevelopmentLine devLineBCopy =
(IDevelopmentLine)processItemService.getMutableCopy(devLineB);
devLineBCopy.addIteration(iterationI);

IDDevelopmentLine devLineACopy =
(IDevelopmentLine)processItemService.getMutableCopy(devLineA);
devLineACopy.removeIteration(iterationI);

IProcessItem[] itemsToSave =
new IProcessItem[]{devLineACopy, devLineBCopy, iterationCopy};
IProcessItem[] savedItems =
processItemService.save(itemsToSave, 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 =
(IDevelopmentLine)processItemService.getMutableCopy(dl);
devLineCopy.removeIteration(iterationI);
IProcessItem[] itemsToSave = new IProcessItem[]{devLineCopy};
IProcessItem[] savedItems = processItemService.save(itemsToSave, 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?

0 votes



One answer

Permanent link
Hi Andy,

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

Parker Dunton
Jazz Foundation | Process team

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,007

Question asked: Jul 26 '11, 4:41 p.m.

Question was seen: 5,704 times

Last updated: Jul 26 '11, 4:41 p.m.

Confirmation Cancel Confirm