RTC Plain Java API: How to get parent team areas / project area for an ITeamArea
Accepted answer
ITeamArea has getProjectArea() to get the IProjectAreaHandle, resolving which will get you IProjectArea
You can use IProjectArea.getTeamAreaHierarchy(); which will return you ITeamAreaHierarchy.
ITeamAreaHierarchy has a lot of methods to access the process area tree.
Comments
One other answer
Hi Aradhya,
Im using the following code to for one of my plugin to get the current iteration.
IProjectAreaHandle iProjectAreaHandle = ((IProjectAreaHandle) workItem.getProjectArea());
IProjectArea iProjectArea = (IProjectArea)iProjectAreaHandle;
ITeamAreaHandle teamAreaHandle = null;
String teamAreaName = ((String)workItem.getValue(categoryattribute));
for(ITeamAreaHandle iTeamAreaHandle : (List<ITeamAreaHandle>)iProjectArea.getTeamAreas()) {
if (iTeamAreaHandle.getItemType().getName().equalsIgnoreCase(teamAreaName)) {
teamAreaHandle = iTeamAreaHandle;
}
}
IDevelopmentLine dev = iac.getDevelopmentLine(teamAreaHandle, monitor);
dev.getCurrentIteration();
but here Im getting a class cast exception .. Im a new bee for RTC API so bit confused of what to be used exactly to get what we want.. please correct me if Im wrong some where.
Thanks
Surender