[closed] How can I create child team area using Java API
![]()
How can I create child team areas while creating teamarea. Pasting the below piece of code which I feel should create the child team area but it doesn't. I think my mistake is I am not able to get the child team area name in a handle. Looking at the code below, if someone can help, will be great.
List <TeamAreaHandle> teamlist = area.getTeamAreas();
childTAHandle = findChildTeamArea(teamlist,childteamAreaName,monitor);
area.getTeamAreaHierarchy().addChild(teamArea,childTAHandle);
the method: findChildTeamArea is:
public ITeamAreaHandle findChildTeamArea (List<TeamAreaHandle> teamlist, String ChildTeamID, IProgressMonitor monitor) throws TeamRepositoryException {
for (ITeamAreaHandle teamAreaHandle : teamlist) {
ITeamArea teamArea = (ITeamArea)teamRepository.itemManager().fetchCompleteItem(teamAreaHandle,ItemManager.DEFAULT,monitor); if (ChildTeamID.equals(teamArea.getName())) { return teamAreaHandle; } } return null; } |
The question has been closed for the following reason: "Duplicate Question" by kushsingh Aug 01 '13, 6:52 a.m.
2 answers
![]()
you need to pass the team area HANDLE
once again, please see the javadoc which is available in the product download section for each release since 3.0.1.1 void addChild(ITeamAreaHandle parent, ITeamAreaHandle child)
Comments I understood this addChild method from the doc but my question still remains, can you help me with an example syntax of argument (ITeamAreaHandle child) .Probably I am not getting how to pass this argument so an example syntax would be very helpful. Please reply. once again please see the javadoc, you should have noticed
ITeamArea teamArea = service.createTeamArea(); to the addChild() method |