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

How to get login information - Server side

Hello,

How can I get information about the user that runs the Advisor/Participant on 'Save work item' Server side ?

Thanks.

0 votes


Accepted answer

Permanent link

This is the code I searched for:

IRepositoryItemService itemService = getService(IRepositoryItemService.class);

IContributorHandle contributorHandle = this.getAuthenticatedContributor();

ContributorImpl contributor = (ContributorImpl)itemService.fetchItem(contributorHandle,null);

String loggedInUser = contributor.getUserId();

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Yehiel, code like that can be found here: https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/

I can only encourage you to search for information like that on my blog. I am pretty sure I have covered the most common use cases.


One other answer

Permanent link
use the getAuthenticatedContributor() method on the AbstractService to get the contributor object

with Eclipse, you can view the definitions of all the objects & classes..

0 votes

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: Nov 20 '13, 11:51 a.m.

Question was seen: 5,659 times

Last updated: Nov 21 '13, 9:21 a.m.

Confirmation Cancel Confirm