It's all about the answers!

Ask a question

using role in js


Manuel Losa peña (111) | asked Jan 27 '16, 6:34 a.m.
 Good morning,

i need to retrieve the role of the registrant via javascript.

is there any way you can do it using javascript?

thank you so much.

One answer



permanent link
Donald Nong (14.5k614) | answered Feb 16 '16, 10:11 p.m.
The JavaScript object "com.ibm.team.repository.web.client.internal.AUTHENTICATED_CONTRIBUTOR_ROLES" contains the repository roles (JazzAdmins, and etc). Note that this is meant for internal use only.

I don't know any ways to retrieve the process roles (project level) for a user given the limitation of the JavaScript extension (it's really meant for dealing with the current work item only).

Comments
Ralph Schoon commented Feb 17 '16, 1:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I second that and would also like to state that objects like the one Don mentions above, are only available in the RTC Web UI. They are not available in the JS running in the Eclipse client.

You can use Java to create attribute customizations to access this in Eclipse and in the Web UI. See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ and https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ for example code.

You might be better off using a follow up action, because that only needs to be deployed on the server. See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ for more information about your options.

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.