How to get Contributor Value
I have one custom attribute, the type is contributor type. The problem is I can't get the value of the attribute. I have followed the code that has been provided in "https://jazz.net/forum/questions/202216/how-to-obtain-the-value-of-a-custom-contributor-field-via-a-rtc-participant-plugin" but it always capture null value even though there is a contributor assigned in that attributes. Is there anyone who can give suggestion what should I do and what happened with that?
import com.ibm.team.repository.common.IContributor;
import com.ibm.team.repository.common.IContributorHandle;
import com.ibm.team.repository.service.IRepositoryItemService;
IWorkItemServer workitemserver= getService(IWorkItemServer.class);IAttribute attribute = workitemserver.findAttribute(workItem.getProjectArea(), "customerExperience", monitor);IContributorHandle contributorHandle = (IContributorHandle) workItem.getValue(attribute);IContributor contributor = (IContributor) itemService.fetchItem(contributorHandle, null);
One answer
If you have to print something in Tomcat you are doing it wrong. If you don't follow the Extensions workshop https://jazz.net/library/article/1000 to be able to debug in Jetty, it is pretty much wasted time to try to help as well.
Neither do I see any tests to the instance or null or anything sanity checking code I would expect if you don't have anything better than System.out.println()
Follow the workshop and set up your environment properly.
Comments
Andy Chen
Jul 18 '17, 11:32 p.m.Ardy Lesmana
Jul 19 '17, 1:41 a.m.Andy Chen
Jul 19 '17, 1:58 a.m.Ardy Lesmana
Jul 19 '17, 2:01 a.m.Andy Chen
Jul 19 '17, 2:17 a.m.Ardy Lesmana
Jul 19 '17, 2:22 a.m.Andy Chen
Jul 19 '17, 2:32 a.m.Ardy Lesmana
Jul 19 '17, 3:37 a.m.