Accessing Role Assignments of a specific team area via REST Api
Hallo,
for my current project i need to get all contributor roles of a team area and team area only using REST api. I tried to get them using Process Api and Reportable REST Api, but every time i get all contributor roles for the entire hierarchy in wich particular team area is part of.
The two calls i am using look like this:
- Process Api https://[serverpath]/ccm/process/project-areas/[projectAreaUUID]/team-areas/[teamAreaUUID]/members/[userID]/role-assignment
- Reportable REST: https://[serverpath]/ccm/rpt/repository/foundation?fields=foundation/teamArea[itemId=%27teamAreaUUID%27]/roleAssignments[contributor/userId='userID']/(contributorRoles/id)
I know that by using JAVA Api i can get roles for specific process area. Is it possible to do the same with any particular REST Api?
2 answers
Isn't /ccm/rpt/repository/foundation?fields=foundation/teamArea[itemId=%27teamAreaUUID%27]/roles just what you want? I'm not quite sure why you included contributors/users in your example.
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#teamArea_type_com_ibm_team_proce
Comments
showing 5 of 6
show 1 more comments
Hello Fabien,
Yes, we have got whatever we were expecting. And for this we have used the internal API -
/ccm/service/com.ibm.team.process.internal.service.web.IProcessWebUIService/teamAreaByUUIDWithLimitedMembers?processAreaItemId=<teamAreaUUID>.
As a response we will get a SOAP response, in which you have an element "<members>...</members>", as shown below -
This will provide us a details, process roles assigned to each member of the team.
<members>
<itemId>_6JGiMbBTEeSuG621rZPROg</itemId>
<archived>false</archived>
<emailAddress>abc.com</emailAddress>
<name>abc</name>
<userId>abc@abc</userId>
<processRoles>
<description>
The default role, implicitly assigned to each user. This role cannot be assigned, removed, or reordered.
</description>
<id>default</id>
<label>default</label>
<cardinality>0</cardinality>
</processRoles>
</members>
and there will be an element <admins>...</admins> which explains the admin member details. as shown below -
<admins>
<itemId>_6JGiMbBTEeSuG621rZPROg</itemId>
<archived>false</archived>
<emailAddress>abc.com</emailAddress>
<name>abc</name>
<userId>abc@abc</userId>
<processRoles>
<description>
The default role, implicitly assigned to each user. This role cannot be assigned, removed, or reordered.
</description>
<id>default</id>
<label>default</label>
<cardinality>0</cardinality>
</processRoles>
</admins>.
We have used XPathExpression to resolve the xml to construct required POJO's.
Hope that answered your question.
Thank you,
Praveen S H
Comments
Marko Tomljenovic
Sep 21 '17, 5:12 a.m.