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.
Comments
Buzz Moschetti
Jan 28 '13, 10:55 p.m.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.