TFS Work Item Query

I am doing a query with the tfs work item query action and get the followning error.
what am I doing wrong or does it not support this?

Querying for work items...
Connecting to server 'http://tfsdev:8080/tfs/defaultcollection' using current credentials...
Authenticating...
Work item query : SELECT [System.Id], [System.Links.LinkType], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State]
FROM WorkItemLinks
WHERE ([Source].[System.TeamProject] = @project 
AND  [Source].[System.WorkItemType] = 'Product Backlog Item' 
AND  [Source].[System.State] = 'Committed')
And ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Reverse')
And ([Target].[System.WorkItemType] = 'Sprint' 
AND  [Target].[System.Id] = 166) ORDER BY [System.Id]
mode(MayContain)
Could not execute query : TF248021: You have specified a query string that is not valid when you use the query method for a flat list of work items. You cannot specify a parameterized query or a query string for linked work items with the query method you specified.
 

Thanks,

Garth

Hi Garth,
It seems that hierarchical queries are not supported by the API call FinalBuilder is making to TFS (WorkItemStore.Query).

From what I can tell, in order to do what you’re after you need to run a series of specific queries based on which work items you want. Unfortunately as this is very dependent on your situation it doesn’t make sense for us to create a FinalBuilder action for it, or to modify the existing action.

These links may help if you decide to write your own API calls:
http://archive.msdn.microsoft.com/TfsSdk/Thread/View.aspx?ThreadId=3517
http://social.msdn.microsoft.com/Forums/is/tfsworkitemtracking/thread/74398c8d-74cd-4bbf-80c9-4ad7ab925d65

Sorry I couldn’t be more help.

Ben