How to use javascript API to get all the users' ID/accounts in an role by the role name?
Accepted answer
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
2 other answers
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.
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.
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.
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.
Comments
Albert Yao
Dec 28 '12, 1:35 a.m.