1

是否可以在子团队区域中添加用户和角色?我的代码目前可以在团队区域中添加用户和角色,但是如何在子团队区域中添加它们。

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

我试图找到层次结构的东西,但没有找到将贡献者添加到子团队区域的选项。

IProjectArea workinCopyProjectArea = (IProjectArea) projectArea.getWorkingCopy();
            ITeamAreaHierarchy teamAreaHierarchy = (TeamAreaHierarchy) workinCopyProjectArea.getTeamAreaHierarchy();
4

1 回答 1

0

projectArea.getWorkingCopy();被描述为在这个线程中不起作用

虽然这是:

ProjectAreaWorkingCopy wc = new ProjectAreaWorkingCopy(projectArea);
wc.addMembers(c);
于 2013-08-01T21:03:04.427 回答