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

How to fetch Team Hierarchy for a new Team Area in an OperationAdvisor for saveTeamArea

 Hello
I'm working at an OperationAdvisor for saveTeamArea. In this precondition I need the parent team of this new team. But I don't know how to get this information.

As far as I know I can use the method ".getParent" on the ITeamHIerarchy object for getting the parent team. But the problem is, that I need the project area object itself to get the ITeamHierarchy. And there is the problem. If I try to fetch the Project area with following code

IProjectArea projectArea = (IProjectArea) repositoryService.fetchItem(
processArea.getProjectArea(), null);
                ITeamAreaHierarchy hierarchy = projectArea.getTeamAreaHierarchy();
ITeamAreaHandle parentTeam = hierarchy
.getParent((ITeamAreaHandle) teamArea.getItemHandle());

I receive the exception 

com.ibm.team.process.common.TeamAreaHierarchyException: Child team area is not part of this team area hierarchy
at com.ibm.team.process.internal.common.util.TeamAreaHierarchy.check(TeamAreaHierarchy.java:466)
at com.ibm.team.process.internal.common.util.TeamAreaHierarchy.getParent(TeamAreaHierarchy.java:142)

I understand also the reason for the exception. I have a new team area that is not saved and that is handled by my OperationAdvisor. With the operation "fetchItem" I got the actual state from the repository WITHOUT my new team (because the save is still not completed). Therefore I can't identify the parent team.

Did anybody know a solution how to identify the parent team in the OperationAdvisor?

0 votes



One answer

Permanent link
Have you tried to use .getProjectArea() on the process Area?

1 vote

Comments
Yes, I have.

 processArea.getProjectArea() returns an IProjectAreaHandle. If I now use the method fetchItem I get the ProjectArea before the save. And that leads to the Exception I have mentioned.

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

Question asked: Oct 13 '14, 7:44 a.m.

Question was seen: 3,968 times

Last updated: Oct 13 '14, 8:04 a.m.

Confirmation Cancel Confirm