It's all about the answers!

Ask a question

Querying with Work Item field type in Where clause


Michael Walker (99215201157) | asked Sep 22 '09, 2:19 p.m.
I added a custom field to the Defect Work Item where I can link the defect to the Story that caused the defect. I used the field type "Work Item" for this field so I can search the Stories and add the link.

When I try and query on this new field as part of the Where clause it doesn't return any of the defects under that story. In the Query Editor I am able to put a check in the box for the Story I want to query on.

If I use this field as part of the Select it appears in the query output, but it doesn't seem to work in the Where clause. Is this a known issue and is there a way around it?

One answer



permanent link
Michael Walker (99215201157) | answered Sep 22 '09, 2:20 p.m.
I added a custom field to the Defect Work Item where I can link the defect to the Story that caused the defect. I used the field type "Work Item" for this field so I can search the Stories and add the link.

When I try and query on this new field as part of the Where clause it doesn't return any of the defects under that story. In the Query Editor I am able to put a check in the box for the Story I want to query on.

If I use this field as part of the Select it appears in the query output, but it doesn't seem to work in the Where clause. Is this a known issue and is there a way around it?


I figured out a workaround where I query on the Links Summary field and I'll then get the defects returned, but I'm still curious if the above is possible since it's easier to create the queries that way.

Your answer


Register or 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.