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

How can I get the current user from a server-side advisor?

I'm sure this is easy but I haven't been able to find it.

I need to get the "current user" from within the run() method of a validator.  I was hoping there was some nice API but didn't seem to find anything other than getting the "getModifiedBy()" from the newState() (which would then be the user who is going to be set as the person who last modified the work item).  Is there anything else?

0 votes


Accepted answer

Permanent link
the AbstractService class provides

getAuthenticatedContributor();

in eclipse, enter a blank line, ctrl-spacebar will show all the methods available
Susan Hanson selected this answer as the correct answer

1 vote

Comments

I figured it was easy ... I hadn't thought to check against the AbstractService class.  Perhaps I need to get more coffee before I start work :-)

its always figuring out where to look.. way too many places most of the time.

I am sure I have blogged about it. Should be in here: https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ .

yes, I rarely search your blog for solutions (you are ahead of me on a few things!), more to help others..

The whole point of the blog is to provide the typical examples. It works for a lot of people, I hope 8D

yes.. as I said, I DO try to reference your content for others, who are learning like me, (before your blog existed).  but I don't know every line of code in your blog, so its a little hard..

Me neither Sam. I use the search field and, after limiting down the hits, the browser search, when searching for API. This works very well, however, I have an advantage, that's for sure.

Thanks for helping here on the Forum Sam. You contribute a lot.

my pleasure.

showing 5 of 8 show 3 more comments

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,938

Question asked: Sep 17 '14, 8:32 a.m.

Question was seen: 3,454 times

Last updated: Sep 17 '14, 10:41 a.m.

Confirmation Cancel Confirm