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

Get all possible values for Planned for attribute when creating a new work item?

 Hey, I want to get the list with all possible values for the field planned for ( target property)I want all of the possible values, not  just for a certain work item, because for that I have getValue.
Thanks

0 votes

Comments

Ioana, sorry for the answer to the wrong post. I deleted the wrong answer here. And reposed it on the right question.


Accepted answer

Permanent link
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.
Ralph Schoon selected this answer as the correct answer

1 vote

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.

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
× 10,937

Question asked: Aug 02 '12, 5:25 a.m.

Question was seen: 4,616 times

Last updated: Aug 02 '12, 9:41 a.m.

Confirmation Cancel Confirm