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

How to use Javascript to set the logon user (authenticated user) as default OWNER?

I have a Javascript that based on certain WorkItemAttributes.TYPE, it sets a specific user to the WorkItemAttributes.OWNER, otherwise, I would like to use the logon user (i.e., 'authenticated user' seen in Customization attribute for User) to be the default OWNER. So how do I get the UUID of the logon user/authenticated user using Javascript?

0 votes



2 answers

Permanent link
Not sure whether you can get the UUID, but using JavaScript to get the current logged on user was quite a popular topic in the forum in the past. See the answers in these post for code snippets.
https://jazz.net/forum/questions/68374/how-can-i-get-logged-in-user-in-javascript
https://jazz.net/forum/questions/170556/how-to-get-user-loged-in-rtc-for-customization
https://jazz.net/forum/questions/133477/work-item-customization-getting-current-user-as-logged-in-user

If you are new to attribute customization, this tutorial is a good start.
https://jazz.net/library/article/537

And you can find most of the API specifications here.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization

1 vote

Comments

Thanks, Donald, for replying. From what I've read, there's NO way to get the logged on user from Attribute Customization using Javascript. Too bad though because it seems to be a very useful thing to have as it has been a popular topic in the forum.


Permanent link
Please see answer https://jazz.net/forum/questions/133477/work-item-customization-getting-current-user-as-logged-in-user/184711 for how to get the item ID for the user that runs the operation.

0 votes

Comments

Thanks to Amaury Quintero for providing this info.

Hi Ralph, unfortunately, with JavaScript for work item customization, the use of com.ibm.team.repository.web.client.session.Session is not accessible.

Ralph, I believe that in https://jazz.net/forum/questions/68374/how-can-i-get-logged-in-user-in-javascript , you also commented that "I tried that in the context of a Calculated Value Provider and the dojo.require() statement for the Session object prevents the script from loading. The internal scripting engine does not have the session object exposed.
https://jazz.net/wiki/bin/view/Main/AttributeCustomizationExamples#Get_an_item_s_UUID_users_iterati indicates that there is no access to the logged in user."

And that's the same problem I'm experiencing, i.e., cannot load the Session.

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
× 6,122

Question asked: May 20 '15, 6:39 p.m.

Question was seen: 3,044 times

Last updated: May 21 '15, 4:48 p.m.

Confirmation Cancel Confirm