RTC Plain Java API: How to get parent team areas / project area for an ITeamArea
Hello all,
I use the RTC Plain Java API in version 4.0.4 and need to get the parent team areas of a given ITeamArea until the top-level IProjectArea is discovered (I also need the name of the IProjectArea at the end). Is that possible? Kind regards and thanks Martin Muellenberg |
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.
Martin Muellenberg selected this answer as the correct answer
Comments
Martin Muellenberg
commented Oct 24 '13, 2:43 a.m.
Hello Aradhya,
Just found the solution I was looking for:
This post shows a lot of the required API in a working example: https://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/
|
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
Comments
Ralph Schoon
commented Mar 10 '14, 9:58 a.m.
| edited Mar 10 '14, 9:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can not just cast an IProjectAreaHandle to an IProjectArea object, you have to look it up and resolve the handle like in my answer on the other post where you asked.
|
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.