It's all about the answers!

Ask a question

How can I use REST API to find work items that do not have a parent?


David Connolly (111) | asked Jun 24 '16, 3:08 p.m.
I'm trying to use REST to find "orphaned" task work items - that is tasks that do not have a parent story or defect. There are two parts to the problem.

1) I tried adding a filter query on parent/id but it's not queryable. I also just tried "parent" but get "unsupported type name" error. Is there some other way that I can filter based on parent?

2) Assuming there is a way to filter on parent, there's a more general question: How do I use REST API to detect that a field is empty/null/not set?

One answer



permanent link
Donald Nong (14.5k414) | answered Jun 26 '16, 8:29 p.m.
I don't think you can test empty/null/nonexistence when using the REST API.

If you do not have to use the REST API, a simple work item query should suffice. Just set the condition to (Parent do not exist) & (Type is Task). If you need to do some post-processing using some kind of script, you can download the result set as a CSV file.

Your answer


Register or to post your answer.