How to obtain the value of a custom contributor field via a RTC participant plugin?
![]() Hello,
I have a work item with a custom field (of type Contributor) called: Requested By:
If for example, this field is set to "John Smith", how can I get the name of the user which is set in the work item via a RTC participant plugin? /** Thanks!
|
Accepted answer
![]()
Thanks Ralph.
I have it working now :-) import com.ibm.team.repository.common.IContributor; import com.ibm.team.repository.common.IContributorHandle; import com.ibm.team.repository.service.IRepositoryItemService; ----------------------------------------------------------- IRepositoryItemService itemService = getService(IRepositoryItemService.class); ----------------------------------------------------------- /** * Gets the value of a Work Item (Contributor (User)) attribute. Ralph Schoon selected this answer as the correct answer
|
One other answer
![]()
Ralph Schoon (62.0k●3●36●43)
| answered Jul 14 '15, 6:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 14 '15, 6:11 a.m.
Do a getValue()
Test if the instance of the object is an IContributorHandle, cast to the IContributorHandle, resolve the contributor from the handle. See https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ This is true for almost all the values. You have to always cast the data and it is easy enough to look at what it is in a debugging session. Also see https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ |