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

Retrieve the username of the modifier of a workItem

Hi

I am trying to retrieve the username of the person who logged in to a particular workitem and is making the changes.

I tried newState.getModifiedBy(). This shows a null value. The getOwner() also did not have the username.

Please guide.

0 votes



4 answers

Permanent link
may be worth a try:

wiattrib = com.ibm.team.workitem.api.common.WorkItemAttributes
mod_by = workItem.getValue(wiattrib .MODIFIED_BY )


0 votes


Permanent link
The above answer did not work. Could anyone guide please?

Thanks

0 votes


Permanent link
wiattrib = com.ibm.team.workitem.api.common.WorkItemAttributes
mod_by = workItem.getValue(wiattrib.MODIFIED_BY)

is for a java script based customization. You are apparently trying to create an Advisor or Participant.

Please provide that kind of information in your question next time.

Please see http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ how to get an attribute value on the server (in updateParent() and getDuration()). You are looking for the attribute Id modifiedBy or maybe try unsing IWorkItem.MODIFIED_BY_PROPERTY.

0 votes


Permanent link
Thank you Ralph, for replying. I was able to get help to retrieve the userId. The following worked for me.

IContributor authenticatedContributor = (IContributor)(getService(IRepositoryItemService.class).fetchItem(getAuthenticatedContributor(), null));
        authenticatedContributor.getUserId();

Thanks,
Ananya

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
× 369

Question asked: Oct 11 '12, 2:54 a.m.

Question was seen: 6,171 times

Last updated: Dec 21 '12, 4:54 a.m.

Confirmation Cancel Confirm