How to add users and roles in child team area usin

2019-06-03 23:25发布

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();

标签: rtc
1条回答
贪生不怕死
2楼-- · 2019-06-04 00:06

That projectArea.getWorkingCopy(); was described as not working in this thread.

While this was:

ProjectAreaWorkingCopy wc = new ProjectAreaWorkingCopy(projectArea);
wc.addMembers(c);
查看更多
登录 后发表回答