It's all about the answers!

Ask a question

How to get TeamHandle from team hierachy?


Avinash Bamane (20115) | asked Sep 02 '15, 2:42 a.m.
Hello,
I am having Team hierarchy as follows,
Main Project Area
     Team A
             Team1
                    Child 1
                    Child 2
             Team 2
                    Child 3
                    Child 4
   Team B....
Likewise I have number of teams. And members are added at 'Child 1', Child 2' level with different roles.
Now I have Category associated with Team A and Team B and category name is same as Child name.
e.g Category Child 1 is associated with Team A
      Category Child 2 is associated with Team A

Now, when user selects category in 'Filed Against', I need to pick all members from that team and need to display in another list. Right now, I am using following code,

List associatedTeamAres = filedAginstDetails.getAssociatedTeamAreas();
for (int i = 0; i < associatedTeamAres.size(); i++) {
                        ITeamAreaHandle tah = (ITeamAreaHandle) associatedTeamAres.get(i);
                        ITeamAreaHierarchy temp=tempAprea.getTeamAreaHierarchy();
                        Set<ITeamAreaHandle> children=temp.getChildren(tah);
}

Likewise, using hierarchy I am traversing till child team, but in future this hierarchy may change, so this code will fail. So, is there any way to get child team directly from any parent team considering Filed Against value.

Thanks in advance.

One answer



permanent link
Martha (Ruby) Andrews (3.0k44251) | answered Sep 02 '15, 1:17 p.m.
JAZZ DEVELOPER
Are you asking if there is a method that will return all descendents: children, grandchildren, etc?
If so, there is not such a method; you must traverse the hierarchy.

Ruby
Martha (Ruby) Andrews
Jazz Foundation L3 Development Team Lead

Comments
Avinash Bamane commented Sep 03 '15, 2:33 a.m.

Hello Ruby,
Thanks for reply.
Here is what I want, (please consider above scenario)
We have associate Category as 'Child 1' which is associated to 'Team A'. So , when user will select Child 1 in 'Filed Against', i would like to get all members from 'Child 1'. right now I am traversing hierarchy. So, is there any way to reach directly to Child 1 and get all members?

Thanks.

Your answer


Register or to post your answer.