How to from either command line or the rest API to traverse and found all parents of a work item
I need to find all parents of a work item. How can I accomplish this using either command line or the rest API
Thank You! |
2 answers
Ralph Schoon (63.3k●3●36●46)
| answered Aug 21 '15, 4:16 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There can only be one parent. See https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/
Comments
nannette Mori
commented Aug 21 '15, 4:32 p.m.
I guess I was not clear I need to traverse the tree of parents
example: I have a story, from the story I want to know what the Feature is, and from the feature I want to know what the epic was |
If you are using OSLC API, namely, accessing the work item via the URL such as /ccm/resource/itemName/com.ibm.team.workitem.WorkItem/114, you can find the parent work item in two places within the response body.
1. In the <Description> itself. <rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent rdf:resource="https://clm:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/43" /> 2. In a separete "node". <rdf:Description rdf:nodeID="A4"> <rdf:subject rdf:resource="https://clm:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/114"/> <rdf:predicate rdf:resource="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/com.ibm.team.workitem.linktype.parentworkitem.parent"/> <rdf:object rdf:resource="https://clm:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/43"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:title>43: Implement - Requests sent in form of email</dcterms:title> </rdf:Description> If you are using the reportable REST API, you can query the parent directly using the URL such as /ccm/rpt/repository/workitem?fields=workitem/workItem[id=114]/parent/*. You can even get the grandparent, great-grandparent in the same query if you so desire /ccm/rpt/repository/workitem?fields=workitem/workItem[id=114]/(id|summary|parent/(id|summary|parent/(id|summary|parent/(id|summary)))). |
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.