It's all about the answers!

Ask a question

How to add users and roles in child team area using plain java API


Kaushambi Singh (371310379) | asked Aug 01 '13, 4:44 p.m.
 Is it possible to add users and roles in child team area? My code currently can add users and roles in team areas but how can I add them in child team area.
ITeamArea TA = (ITeamArea)teamRepository.itemManager().fetchCompleteItem(newTAHandle,ItemManager.DEFAULT,monitor);
 IContributor contributor = teamRepository.contributorManager().fetchContributorByUserId(members,monitor);
 ArrayList roles  = getTeamRoleName(projectArea,member_roles);
 IProcessAreaWorkingCopy areaWc = (IProcessAreaWorkingCopy)service.getWorkingCopyManager().createPrivateWorkingCopy(TA);  
 areaWc.getTeam().addContributorsSettingRoleCast( new IContributor[] {contributor}, new IRole[] {roles})); 
 areaWc.save(null);

I was trying to find the hierarchy stuff, but then not finding the option of adding contributors to child team area.
IProjectArea workinCopyProjectArea = (IProjectArea) projectArea.getWorkingCopy();
ITeamAreaHierarchy teamAreaHierarchy = (TeamAreaHierarchy) workinCopyProjectArea.getTeamAreaHierarchy();

One answer



permanent link
Ralph Schoon (62.7k33643) | answered Aug 02 '13, 1:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You get the ITeamArea of the sub team and use the same API you use for the top level team area.

Comments
Ralph Schoon commented Aug 02 '13, 2:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your answer


Register or to post your answer.