It's all about the answers!

Ask a question

Accessing Role Assignments of a specific team area via REST Api


Vladislav Ladyzhenskiy (614) | asked Sep 21 '17, 3:12 a.m.
edited Sep 21 '17, 5:00 a.m.

 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?


Comments
Marko Tomljenovic commented Sep 21 '17, 5:12 a.m. | edited Sep 21 '17, 5:12 a.m.

 The problem here is that we want the roles that are explicitly assigned to the user in the given team area. But what we get is the number of roles that the user in the end has in the context of the team area.

2 answers



permanent link
Donald Nong (14.5k414) | answered Sep 21 '17, 8:04 p.m.

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
Vladislav Ladyzhenskiy commented Sep 22 '17, 3:10 a.m.

 Hello Donald. Thank you for your answer. 


As Marko mentioned we want only the roles which contributers have in the specific team area. Your suggestion would retrieve the pool of roles defined for this team area, from wich roles are assigned to process members. 


Marko Tomljenovic commented Sep 22 '17, 3:13 a.m.

We do not need the information which roles are available in the context of a specific team area.

What we need is to know which roles are explicitly assigned to the users that are explicit members of a given team/project area.


Donald Nong commented Sep 22 '17, 5:08 a.m.

Now I understand what you try to do. So, if user Marko has Team Member role in the project area, while having Scrum Master role in a team area, you want to show him having just the Scrum Master role in the team area, just like what the Manage Team Area page shows, not effectively having both Team Member and Scrum Master roles. Correct?

What is the purpose of knowing such role assignments? In most cases, knowing the effective role(s) will be more beneficial, and your use case may be quite unique.


Marko Tomljenovic commented Sep 22 '17, 5:31 a.m.

 Due to our highly complex CLM setup and usage we need to develop our own CLM user administration tool. And this tool needs to know the exact role assignments and not the effective ones.


Donald Nong commented Sep 22 '17, 6:13 a.m.

In that case, probably have a look at the internal API
/ccm/service/com.ibm.team.process.internal.service.web.IProcessWebUIService/teamAreaByUUIDWithLimitedMembers?processAreaItemId=<teamAreaUUID>

It is called when you open the Manage Team Area page.

Generally speaking, using internal APIs is not recommended, as they may change without notice, and you cannot get any support on them.


Fabien Araktingi commented Nov 10 '17, 3:55 a.m. | edited Nov 13 '17, 5:20 a.m.

Hi Marko,

I'm just curious whether you got a chance to obtain what you were looking for.

And if this is the case I'm really interested to know how you performed it.

Thanks for your feedback,
Fabien

showing 5 of 6 show 1 more comments

permanent link
praveen hanchinamani (2729) | answered Nov 13 '17, 12:12 a.m.
edited Nov 13 '17, 12:14 a.m.

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
Fabien Araktingi commented Nov 13 '17, 2:51 a.m. | edited Nov 13 '17, 5:21 a.m.

Thanks for your help Praveen!!!

That will help us a lot.

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.