Get all possible values for Planned for attribute when creating a new work item?
Accepted answer
I believe that the following should work however I've not tested it:
URI projectAreaUri = ... IProcessClientService processClient = (IProcessClientService) repository.getClientLibrary(IProcessClientService.class); IAuditableClient auditableClient = (IAuditableClient) repository.getClientLibrary(IAuditableClient.class); IProjectArea projectArea = (IProjectArea) processClient.findProcessArea(projectAreaUri, null, null); IDevelopmentLineHandle[] developmentLineHandles = projectArea.getDevelopmentLines(); for(IDevelopmentLineHandle developmentLineHandle : developmentLineHandles) { IDevelopmentLine developmentLine = auditableClient.resolveAuditable(developmentLineHandle, ItemProfile.DEVELOPMENT_LINE_DEFAULT, null); for(IIterationHandle iterationHandles : developmentLine.getIterations()) { IIteration iteration = auditableClient.resolveAuditable(iterationHandles, ItemProfile.ITERATION_DEFAULT, null); System.out.println(iteration.getName()); } }
If you're only interested in the main project timeline you can call IProjectArea#getProjectDevelopmentLine() instead.
Comments
Thanks. The thing is that with this solution I get only the main iteration names and I need all possible values, including the children of the each iteration.
Have you looked at the methods of IIteration? Try iteration.getChildren() to get the next lower level.
Yes. I'm just using it right now to see if it works.
Hey. It works with the getChildren(). It got me what I needed, the only thing is that when I look in RTC and when I look at my printed list some values are not always the same. I need to investigate that. I am using iterationChild.getName(). But overall, the answer above is the right one. Thank you again.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 02 '12, 6:21 a.m.Ioana, sorry for the answer to the wrong post. I deleted the wrong answer here. And reposed it on the right question.