Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC Reportable API - Get list of teams' members for a project

Hello,
Is there a way to get list of teams' members for a project using the RTC reportable APIs?

Thank you

0 votes



2 answers

Permanent link
how about this
https://jazz:9443/jazz/rpt/repository/foundation?fields=foundation/teamArea/%28name|teamMembers/name|projectArea/name%29

2 votes


Permanent link
    @SuppressWarnings("unchecked")
    public List<ITeamArea> getProjectTeamsByName(String name) throws TeamRepositoryException {
        IProjectArea project = getProjectByName(name);
        if(project != null){
            List<ITeamAreaHandle> teamHandles = project.getTeamAreas();
            List<ITeamArea> teams = new ArrayList<ITeamArea>();
            for(ITeamAreaHandle handle : teamHandles)
                teams.add((ITeamArea)repo.itemManager().fetchCompleteItem((ITeamAreaHandle)handle, IItemManager.DEFAULT, MONITOR));
            return teams;
        }
        return null;
    }
    public String getProjectsRoleListName(String projectName) throws TeamRepositoryException{
        String list = "";
        IProjectArea project = getProjectByName(projectName);
        if(project == null)
            throw new TeamRepositoryException("Could not find project " + projectName);
       
        IContributorHandle[] members = project.getMembers();

        IProcessItemService service = (IProcessItemService)repo.getClientLibrary(IProcessItemService.class);
        IClientProcess client_service = service.getClientProcess(project,MONITOR);
        IRole[] availableRoles    = client_service.getRoles(project,MONITOR);

        String roles = "\t\t";
        for (int k = 0; k < availableRoles.length; k++) {               
            if(k != 0)
                roles += ",";
            roles += availableRoles[k].getId(); // + " - " + availableRoles[k].getDescription();
        }
       
        list += "\tAvailiable Roles - " + roles +"\n\n";
               
        for(int i = 0; i < members.length; i ++){
            IContributor member = (IContributor)repo.itemManager().fetchCompleteItem(members[i], IItemManager.DEFAULT, MONITOR);
            IRole[] memberRoles    = client_service.getContributorRoles(member,project,MONITOR);
                       
            roles = "\t\t";
            for (int k = 0; k < memberRoles.length; k++) {               
                if(k != 0)
                    roles += ",";
                roles += memberRoles[k].getId(); // + " - " + availableRoles[k].getDescription();
            }
            list += "\n\t"+ member.getUserId() + "\n" + roles;           
        }
        return list;
    }

0 votes

Comments

Thanks but I'm looking for REST reportable API. For instance to get the project's members I can use the following but how can I use a similar query to get the list of teams with their members for a given project?
Thanks

https://server:9443/ccm/rpt/repository/foundation?fields=foundation/projectArea/(name|teamMembers/name|modified|modifiedBy/name)&size=300&pos=0

Perfect thanks a lot - It works fine

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Mar 27 '14, 9:07 a.m.

Question was seen: 5,933 times

Last updated: Mar 28 '14, 11:47 a.m.

Confirmation Cancel Confirm