It's all about the answers!

Ask a question

how to get team area member list by server api


WenJia Zhang (113) | asked Jul 09 '19, 2:48 a.m.
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();

but i need to get this team area memeber list
any one knows?

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Jul 09 '19, 3:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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>

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.