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")
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
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
Accepted answer
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()
get their children
IIteration->getChildren()
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()
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.