how to get team area member list by server api
how to get team area member list by server api?
I found I can get team area name :
ICategoryHandle categoryHandle = newState.getCategory();
ICategory category = iac.resolveAuditable(categoryHandle, ICategory.DEFAULT_PROFILE, null);
List teamAreas = category.getAssociatedTeamAreas();
String teamAreaString=category.getName();
ICategory category = iac.resolveAuditable(categoryHandle, ICategory.DEFAULT_PROFILE, null);
List teamAreas = category.getAssociatedTeamAreas();
String teamAreaString=category.getName();
but i need to get this team area memeber list
any one knows?
One answer
From, https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ slightly modified assuming you have a project or team area:
/*
* Finds contributors by role on a process area.
*
* @param processArea
* @param roleName
* @param monitor
* @return
* @throws TeamRepositoryException
/
private IContributorHandle[] findContributorByRole(
IProcessArea processArea, String roleName,
IProgressMonitor monitor) throws TeamRepositoryException {
IProcessServerService processServerService = getService(IProcessServerService.class);
IContributorHandle[] members = processArea.getMembers();
IContributorHandle[] matchingContributors = processServerService
.getContributorsWithRole(members, processArea,
new String[] { roleName });
return matchingContributors;
}
private IContributor getContributorFromHandle(IContributorHandle handle) throws TeamRepositoryException{
IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);;
return (IContributor) repositoryItemService.fetchItem(handle, IRepositoryItemService.COMPLETE);
}
</pre>