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

How do I get the Project Area of an Iteration

Hello
My task is to create a method that can export all plans of a project to a textfile. After searching for a long time, I've finally found a method to get the plans programmatically:
https://jazz.net/wiki/bin/view/Main/InformalProjectCopy (under "Agile Planning")
List<IIterationPlanRecordHandle> handles= source.fetchAllIterationPlans(ItemProfile.createFullProfile(IIterationPlanRecord.ITEM_TYPE), monitor);
List<IIterationPlanRecord> plans= source.getItemManager().fetchCompleteItems(handles, IItemManager.DEFAULT, monitor);
However, this method gets me all plans of all project areas that I have access to, and I can't find a way to filter only the plans that are in the current project area. That's why I made a subfunction that whould check if the iteration lies within the current project area. The problem is, that I can't find an option to get the project area of an iteration, and looping the getParent command also doesn't work, because it only gets to the top level iteration, but not the Project Area itself.
I'd either need an option to only search through the current project area with the linked method, or a command to get the project area of an iteration. If anyone knows a way to do any of these, I'd much appreciate the help.

Thanks

0 votes


Accepted answer

Permanent link
I don't think you can find the backlink,

so you have to get all the interations in a project (in their developmentlines),
and make a hash table or something to be able to go backwards.

ProjectArea->getDevelopmentLines()
IDevelopmentLineHandle[] getDevelopmentLines()
IDevelopmentLine->getIterations()

  IIterationHandle[] getIterations()

get their children

IIteration->getChildren()
  IIterationHandle[] getChildren()
Matthias Lückl selected this answer as the correct answer

1 vote

Comments

Yes, that whould work. Thanks for the answer!

EDIT: I'm doing something similar. Just getting all iterations of a project whould not help in this case, since I only have to get the iterations that contain a plan. So when I do the check method, that searches through all levels of an Iteration, I get the top level iterations the way you described, and compare the IDs of them with the IDs of the top level iterations, which I got with the getParent-loop method.
Simply said, I go backwards and forwards from both sides, top and bottom level.

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,073

Question asked: Dec 03 '12, 4:35 a.m.

Question was seen: 6,292 times

Last updated: Dec 03 '12, 7:32 a.m.

Confirmation Cancel Confirm