It's all about the answers!

Ask a question

How to get login information - Server side


Yehiel Glass (25528786) | asked Nov 20 '13, 11:51 a.m.

Hello,

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

Thanks.

Accepted answer


permanent link
Yehiel Glass (25528786) | answered Nov 21 '13, 8:02 a.m.

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

Comments
Ralph Schoon commented Nov 21 '13, 9:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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
sam detweiler (12.5k6186201) | answered Nov 20 '13, 1:44 p.m.
use the getAuthenticatedContributor() method on the AbstractService to get the contributor object

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

Your answer


Register or to post your answer.