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. |
4 answers
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 |
Ralph Schoon (63.1k●3●36●46)
| answered Oct 17 '12, 6:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 17 '12, 6:34 a.m.
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. |
The above answer did not work. Could anyone guide please?
Thanks |
may be worth a try:
wiattrib =
com.ibm.team.workitem.api.common.WorkItemAttributes
mod_by = workItem.getValue(wiattrib
.MODIFIED_BY
)
|
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.