How to get the "Found In" field from an RTC "defect" type Work Item? Using the Java API
I'm fairly new in working with the API.
I've been trying to get the "Found In" field from an RTC work item by accessing the Work Item's Custom Attributes. Strangely, it did not show in the custom attributes.
I'm trying to figure out a way of getting the information from the Work Item. For example (this doesn't actually work)
IAttribute foundInAttribute = myWorkItemClient.findAttribute(projectAreaHandle, "foundIn", null);
Object foundIn = currentWI.getValue(foundInAttribute);
System.out.println("Found iN!!!" + foundIn.toString());
Thanks.
I've been trying to get the "Found In" field from an RTC work item by accessing the Work Item's Custom Attributes. Strangely, it did not show in the custom attributes.
I'm trying to figure out a way of getting the information from the Work Item. For example (this doesn't actually work)
IAttribute foundInAttribute = myWorkItemClient.findAttribute(projectAreaHandle, "foundIn", null);
Object foundIn = currentWI.getValue(foundInAttribute);
System.out.println("Found iN!!!" + foundIn.toString());
Thanks.
Accepted answer
ah ha, got it.
IAttribute foundInAttribute = myWorkItemClient.findAttribute(projectAreaHandle, "foundIn" , null);
IDeliverableHandle foundInDeliverableHandle = (IDeliverableHandle) currentWI.getValue(foundInAttribute);
if (foundInDeliverableHandle != null){
IDeliverable deliverable = (IDeliverable) this.repository.itemManager().fetchCompleteItem(
foundInDeliverableHandle, IItemManager.DEFAULT, null);
}
IAttribute foundInAttribute = myWorkItemClient.findAttribute(projectAreaHandle, "foundIn" , null);
IDeliverableHandle foundInDeliverableHandle = (IDeliverableHandle) currentWI.getValue(foundInAttribute);
if (foundInDeliverableHandle != null){
IDeliverable deliverable = (IDeliverable) this.repository.itemManager().fetchCompleteItem(
foundInDeliverableHandle, IItemManager.DEFAULT, null);
}
One other answer
I assume you are looking for the Built-in attribute with name Found In, and if so, you may need to use "com.ibm.team.workitem.attribute.version" as the attribute ID. I've never actually tried to get that myself, but looking at some of my work items, that is the attribute ID for the attribute named "Found In".
Susan
Susan
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 08 '14, 11:35 a.m.Minghua Zhao
Jan 08 '14, 12:03 p.m.Minghua Zhao
Jan 08 '14, 12:06 p.m.Minghua Zhao
Jan 08 '14, 1:50 p.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 09 '14, 1:43 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 09 '14, 1:45 a.m.Minghua Zhao
Jan 10 '14, 12:44 p.m.