[SOLVED] Get users with a role on a Teamarea
![]()
Hi,
I'm developing a plugin that needs to get a list of all the members from a teamArea that have a determinated role ( p.e. ScrumMaster ). I've been able to get the IContributor list from the TeamArea, but I can't figure how to get the roles from that team area and match the data or if there is any 'magic' method to get the relation between user/role in a teamArea. Any idea? Thanks! |
4 answers
![]()
Hello Pere,
As per IServerProcess documentation: "A server process is a proxy for the server-side team process for a given project area. Server processes can not be persisted or be returned by a service method" So try following code to get the Server Process from the governing Process Area service: IProcessServerService processService = getService(IProcessServerService.class); IServerProcess serverProcess = processService.getServerProcess(processArea); And the required service you depend on is then "IProcessServerService". Regards, Jorge. |
![]()
Thanks for replying,
I've been trying the second option: getting contributor role: I did: import com.ibm.team.process.service.IServerProcess; I also registered the service 'com.ibm.team.process.service.IServerProcess' in the plugin.xml as a prerequisite. <extension> And iside the prerequiste tag interface="com.ibm.team.process.service.IServerProcess" The problem I get is that when I execute the advisor I get the following error: CRJAZ1115I The service "com.ibm.team.process.service.IServerProcess" is not registered, any idea why this is happening? Thanks! |
![]() Hi, Try below sample code: IServerProcess serverProcess = getProcessService().getServerProcess(fProjectArea); 1. get all roles: IRole[] roles = serverProcess.getRoles(fProjectArea); 2. getting contributor role: IRole[] contributorRoles = serverProcess.getContributorRoles(contributor, fProjectArea); |