It's all about the answers!

Ask a question

delete iterations using Java-API

Max Adler (133) | asked Aug 26 '22, 8:42 a.m.
Dear all,

after the creation of iteration works fine for me I now want to delete not needed iterations. I basically refer to the blog entry moving or deleting an iteration.

Unfortunately it did not work for me. I always got the error:
Iteration 'MyIteration' has no parent, but timeline 'MyTimeline' doesn't consider it a root.

So for me it looks that with devLineCopy.removeIteration(MyIteration) I only remove the iteration from MyTimeline but not delete it in total.

Could you give me a hint what went wrong?

One answer

permanent link
Ralph Schoon (63.3k33646) | answered Aug 26 '22, 10:02 a.m.
edited Aug 26 '22, 10:07 a.m.

That is not a blog, that is a question from someone who tries to figure the API out. 

  1. Did you read the answer to that question?
  2. Did you try to delete an iteration in the UI?

If you did 2, you probably found out that you can not delete iterations in the UI. You can archive them. This is what the answer to the "blog" also suggests.

For all I know you can not delete iterations, you have to archive them.

The method you refer to has this documentation:

* Removes the iteration identified by the given handle from the list of
* iterations. If the iteration does not belong to this development line,
* this method does not have any effect. In order to ensure the consistency
* of the bi-directional relationship, the caller has also to remove the
* development line from the iteration.
* @param iteration a handle to the iteration
void removeIteration(IIterationHandle iteration);

I do not know what it does. I would archive the iteration. If you want to be able to see the code and comments like that, see especially the last chapter of Lab 1 and then run Lab 1 to set up the environment.

PS: I looked for references to that call and found it in some unit tests:

IIteration iteration1 = (IIteration) IIteration.ITEM_TYPE.createItem();
IIteration iteration2 = (IIteration) IIteration.ITEM_TYPE.createItem();
assertFalse(ProcessItemComparisonUtil.equalTimeline(timeline1, timeline2));
assertTrue(ProcessItemComparisonUtil.equalTimeline(timeline1, timeline2));
assertFalse(ProcessItemComparisonUtil.equalTimeline(timeline1, timeline2));
assertFalse(ProcessItemComparisonUtil.equalTimeline(timeline1, timeline2));
assertTrue(ProcessItemComparisonUtil.equalTimeline(timeline1, timeline2));

I am unsure if it is meant to be used in production on data in the database. The reason why I am unsure is, that the unit test code never saves any of these changes.

Your answer

Register or 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.