It's all about the answers!

Ask a question

Retrieve the username of the modifier of a workItem


Ananya Joisa (4552024) | asked Oct 11 '12, 2:54 a.m.
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



permanent link
Dinesh Kumar (4.0k413) | answered Oct 11 '12, 4:39 a.m.
JAZZ DEVELOPER
may be worth a try:

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



permanent link
Ananya Joisa (4552024) | answered Oct 17 '12, 5:57 a.m.
The above answer did not work. Could anyone guide please?

Thanks

permanent link
Ralph Schoon (55.9k23642) | 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.

permanent link
Ananya Joisa (4552024) | answered Dec 21 '12, 4:54 a.m.
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

Your answer


Register or to post your answer.