How to get Work Item found in attribute value?
![]()
pugazhenthi samidurai (264●2●39●42)
| asked Aug 10 '12, 7:11 a.m.
retagged Aug 13 '12, 7:37 p.m. by Nhi P Ta (188●4●10●18)
Hi,
i want to read the value of found in attribute. I have followed this link but still it return null value? https://jazz.net/forum/questions/13501/how-to-get-the-found-in-attribute-for-a-work-item Any Solution? Regards, Pugazh S |
Accepted answer
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Aug 13 '12, 5:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Without any code from you it is impossible to find out what you are doing wrong. I can get the Found in attribute in my code. It should look like:
int id = new Integer(idString).intValue(); IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.SMALL_PROFILE, null); IAttribute foundIn = workItemClient.findAttribute(projectArea, IWorkItem.FOUND_IN_PROPERTY, null); if (workItem.hasAttribute(foundIn)){ IDeliverableHandle foundInValueHandle = (IDeliverableHandle) workItem.getValue(foundIn); IDeliverable foundInValue = (IDeliverable)teamRepository.itemManager().fetchCompleteItem(foundInValueHandle, IItemManager.REFRESH, null); System.out.println("Found In "+ foundInValue.getName() ); } System.out.println("Accessed work item: " + workItem.getId() + "."); pugazhenthi samidurai selected this answer as the correct answer
|
4 other answers
![]()
https://server_port/ccm/oslc/workitems/workitem_number.xml?oslc_cm.properties=rtc_cm:foundIn
Fill in your own server, port and workitem number.
Comments When I try https://server_port/ccm/oslc/workitems/workitem_number.xml?oslc_cm.properties=rtc_cm:foundIn I get page cannot be displayed. When I try s://server_port/ccm/oslc/workitems/ or s://server_port/ccm/oslc/ I get The requested resource () is not available. Do I need to do something to turn on OSLC services or should it be on by default? I experimenting with the standard Windows 7 RTC download. |
![]()
Sorry I haven't done alot of REST API. For some local scripting I needed, I used python, did the authentication, then fetched the XML. Using python libs for XML I was able to retrieve any field I needed.
|
![]()
Hi Ralph Schoon
I get the error while running your code: com.sun.proxy.$Proxy26 cannot be cast to com.ibm.team.workitem.api.common.IDeliverable Could you help? Comments ![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You obviously try to cast something to something, that can't be casted that way.
Debug your code and use the instanceof operation to ensure you can indeed cast the object to what you want to cast it to.
Hi Ralph
Looks good.
|
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.