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

How to use javascript API to get all the users' ID/accounts in an role by the role name?

If I know the role name in the project area, how to use javascript API to get all the users' ID/accounts in the role?
For example, how to get all the members' ID/accounts in the role "Scrum Master"?

1

0 votes

Comments

I find this:  https://jazz.net/forum/questions/65978/solved-get-users-with-a-role-on-a-teamarea,but this is for Java API, not for javascript.


Accepted answer

Permanent link
In RTC 3.x and RTC 4.x at least, it is not possible to access users and roles and the like from JavaScript. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization for what is doable and also https://jazz.net/library/article/1093
Ralph Schoon selected this answer as the correct answer

0 votes


2 other answers

Permanent link
Today, there is no way I would be aware of to get to that information in JavaScript. You can only access the contributor type attributes and get an UUID and the user name. Given a UUID you can set users in scripts too. However, there is no JavaScript API to access the project area and its data.

You would have to use the built in providers Lauren mentioned above. If that is not feasible this workshop will publish some more labs on JavaScript in January. It will however not publish anything on your specific request.

You can look if this approach http://jorgediazblog.wordpress.com/2012/06/27/work-item-customization-httpconector-and-oauth-in-rtc-4-0-for-oslc/ has a way to provide you with the information you need. I am not sure and rather pessimistic.

If it is impossible to get at the information you want you should consider to follow this blog and create a followup action instead.

1 vote


Permanent link
Hi,
I'm not sure how to get all of the users of a given role using javascript.  Depending on what you're trying to do, using Role Based User Lists may work for you: https://jazz.net/help-dev/clm/index.jsp?topic=%2F%2Fcom.ibm.team.workitem.doc%2Ftopics%2Ft_configuring_role_based_user_list.html.

0 votes

Comments
Hi,

I have created a "Role Based User List" value set "tester", but how to get the members of it?


For example, there is an attribute/field "tester" to use the value set, the options/list items in the UI are all the members in the role "tester", I can see all the members in the UI, but I want to know if there is a way to get the options by using javascript?

Hi Albert,

please check https://jazz.net/library/article/1093 Lab 4 talks about this.

 Hi Ralph, 


I do have the similar problem. I didnt find any information related to javacode in the above linked article.


See http://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/

"If it is impossible to get at the information you want you should consider to follow this blog and create a followup action instead."

The article above shows Client API but you should be able to use the complementary server API for the same purpose. The trick is to find the service. It typically has a similar name, that can help.

And this Participant (FollowUp Action) http://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ finds an Approver using Roles. The API used is server API and should help you to get a grip at finding roles similar to the other blog post.

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
× 10,937

Question asked: Dec 28 '12, 1:28 a.m.

Question was seen: 8,113 times

Last updated: Mar 21 '13, 12:21 p.m.

Confirmation Cancel Confirm