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

How get current user in RTC plugin

Hello!
We built an RTC extension plug-in which is triggered when an RTC work item is updated. We need to get the info about current connected user who changed the work item (and this action triggered the plug-in). Is any way get information about the use who is currently modifying the work item?
We tried to use this construction:

IWorkItem oldState = (IWorkItem) saveParameter.getOldState();
iContributorHandle = oldState.getModifiedBy();
wi_tmp = (IWorkItem) oldState;

But it seems that "oldState.getModifiedBy();" returns a user who was modifing the work item before the current modification (another word, it was saved in result of the previous call of the plug-in)!

I will appreciate any advices and ideas!
Thank you in advance!

0 votes


Accepted answer

Permanent link
The old state will return the user ID that modified the work item to get to that state. The new state should give you the current user that modified the work item to this one.

Also, the operational behavior runs in the context of the user that runs the operation. See https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ and https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ which both access the current user using
	IContributorHandle loggedIn = this.getAuthenticatedContributor();
Your extension must extend AbstractService to access this method.
Dmitry A. Lesin selected this answer as the correct answer

0 votes

Comments

Thank you!
It works perfect:

IContributorHandle loggedIn = this.getAuthenticatedContributor();

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,935
× 102
× 70

Question asked: Jun 18 '14, 6:45 a.m.

Question was seen: 4,666 times

Last updated: Jun 18 '14, 8:05 a.m.

Confirmation Cancel Confirm