How to get all iterations in a RTC plugin?
For some reasons, we have a lot(!) of iterations in the project area. Hence, the DropDown list becomes huge.
We want to assign the WI using two custom enumeration fields, and parse them inside a plugin in order to find the required iteration.
In order to check process feasibility, I need to know if I can get a collection of all iterations in my project area in a plugin.
Well, how do I do it?
2 answers
from the project get the Timelines, and from the timelines get the list of iterations
<code>
IDevelopmentLineHandle[] dlh = iprja.getDevelopmentLines();
IDevelopmentLine dl = (IDevelopmentLine) auditableClient .fetchCurrentAuditable(dlh[0],
ItemProfile.createFullProfile(IDevelopmentLine.ITEM_TYPE), null);
// get current iteration for this timeline
IIterationHandle cih = dl.getCurrentIteration();
// get all iterations for this timeline. note this is top level iterations.
// iteration.getChildren() will get the next layer down.
IIterationHandle[] iterations = dl.getIterations();
</code>
<code>
IDevelopmentLineHandle[] dlh = iprja.getDevelopmentLines();
IDevelopmentLine dl = (IDevelopmentLine) auditableClient .fetchCurrentAuditable(dlh[0],
ItemProfile.createFullProfile(IDevelopmentLine.ITEM_TYPE), null);
// get current iteration for this timeline
IIterationHandle cih = dl.getCurrentIteration();
// get all iterations for this timeline. note this is top level iterations.
// iteration.getChildren() will get the next layer down.
IIterationHandle[] iterations = dl.getIterations();
</code>