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

How can I query for work items that do NOT have a parent

As stated, I'd like to find workitems in my system that do not have a parent relationship defined.  I like to have all my work items nested under a story, but sometimes the devs create a work item and forget to set the parent.

How can I find them?

Also, if there is a way to make setting the parent relationship a requirment before a workitem can be saved, that would prevent future occurences.

1 vote

Comments

Are you willing to do some OSLC?

If you want to restrict this to a project area, call this URL as follows:
accept:  application/xml
OSLC-Core-Version: 2.0
{YOURrOOT}'/ccm/oslc/contexts/$projectAreaID/workitems?oslc.prefix=rtc_cm=<http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/>&oslc.properties=rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent

rdfs:member entries will either contain the tag rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.parent or not so you can find the parents.   Note that the call is paging type; you'll have to check for oslc:nextPage in the result and if present, iteratively call it until all pages of data have been fetched.   THere is no way to filter for items whose parent is a story; the filtering doesn't "read thru" the resource link.


Accepted answer

Permanent link
Building on what Sam showed, there is a Parent choice in the query builder.  Select it, and then note that you can choose to include a work item if the parent exists, or does not exist.  In your case, you want "do not exist".

Screen capture


Hooch Holly selected this answer as the correct answer

1 vote


2 other answers

Permanent link

Doh!  I don't know how I missed the "Parent" field in the Query builder. 

Thanks!

0 votes


Permanent link
I see Parent as a choice in the Query builder. both web and eclipse..

allows me to check has or does not have parent set..



don't think there is a required dependent link  function built in.

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
× 12,013
× 9

Question asked: Jan 28 '13, 3:35 p.m.

Question was seen: 6,405 times

Last updated: Jan 29 '13, 1:50 p.m.

Confirmation Cancel Confirm