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

Getting the value for comments from a ResolvedWorkItem?

My code obtains the value for various attributes from a ResolvedWorkItem, based on their respective attribute ids. The following logic generally works fine:

WorkItemUIWorkingCopy uiCopy = (WorkItemUIWorkingCopy) myWorkItemWorkingCopy.getAdapter(IWorkItemUIWorkingCopy.class);

ResolvedWorkItem workItem = uiCopy.getResolvedWorkItem();
Object o = workItem.getValue(someAttributeIdentifier);


However, getValue() throws an exception if the attribute id is "internalComments" (the id for the comments field):

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at com.ibm.team.workitem.client.internal.util.ResolvedWorkItem.getValue(ResolvedWorkItem.java:181)

I've confirmed that the attribute exists within the work item (that is, workItem.findAttribute("internalComments") returns a non-null result, and calling getAttributeType on it returns the value "comments"). What is the right way to get the value for the comments?

Thanks!

Roger

0 votes



One answer

Permanent link
There is a get specific to comments -

IComment[] comments = iWorkItem.getComments().getContents();


From there you can get the creator / data / description of each comment.

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,941

Question asked: Apr 26 '11, 12:45 p.m.

Question was seen: 4,192 times

Last updated: Apr 26 '11, 12:45 p.m.

Confirmation Cancel Confirm