It's all about the answers!

Ask a question

Where can I find a list of IWorkItem attributes


Steve Woodruff (5132) | asked Jun 16 '11, 10:16 a.m.
Where can I find a list of IWorkItem attributes that I can fetch using getValue() ?

Thanks!

-Steve

Accepted answer


permanent link
Nick Edgar (6.5k711) | answered Jun 17 '11, 12:05 p.m.
JAZZ DEVELOPER
Use IItemManager.fetchCompleteItem to fetch the item for any handle. The items carry the actual info; the handles are essentially just like pointers / URLs.

For example:

IContributorHandle contributorHandle = ...
IContributor contributor = (IContributor) teamRepository.itemManager.fetchCompleteItem(contributorHandle, IItemManager.DEFAULT, null); // should really provide a progress monitor in last arg for progress / cancelaton
String name = contributor.getName();


That's for client-side. For server-side, use IRepositoryItemService to fetch the item.
Ralph Schoon selected this answer as the correct answer

4 other answers



permanent link
Ralph Schoon (63.5k33646) | answered Jun 16 '11, 12:18 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Where can I find a list of IWorkItem attributes that I can fetch using getValue() ?

Thanks!

-Steve


Steve,

there are built in operations for a few:


IWorkItem workItem= workingCopy.getWorkItem();
workItem.setHTMLSummary(XMLString.createFromPlainText(fSummary));
workItem.setCategory(fCategory);



Others you can lookup with the name or ID:


IAttribute customString = workItemClient.findAttribute(fProjectArea,
"com.ibm.rtc.ext.custom.test", null);

if(null!=customString && workItem.hasCustomAttribute(customString)){
workItem.setValue(customString, new String("Test"));
}


You can also get a list of attributes, but I seem to be unable to find it right now....

permanent link
Ralph Schoon (63.5k33646) | answered Jun 16 '11, 12:21 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

at least there is a getCustomAttributes() operation.

permanent link
Steve Woodruff (5132) | answered Jun 16 '11, 1:47 p.m.
Thanks for the reply! Maybe I should come out and tell you what I really want... I've queried for the work items associated with a build label and now i want to find the resolver of each of those work items. I know there is a getResolver() method that returns an IContributorHandle, but I'm not sure how to get what I need out of that object.

Thanks!

-Steve

permanent link
Steve Woodruff (5132) | answered Jun 17 '11, 4:03 p.m.
Perfect! Thank you!

Your answer


Register or 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.