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

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!

0 votes



2 answers

Permanent link
There can only be one parent. See https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/

0 votes

Comments

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


Permanent link
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)))).

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

Question asked: Aug 21 '15, 11:50 a.m.

Question was seen: 2,925 times

Last updated: Aug 23 '15, 11:40 p.m.

Related questions
Confirmation Cancel Confirm