views:

35

answers:

1

Is there a way to limit the amount of workitems that gets returned from WorkItemStore.Query?

workItemStore.Query("Select Title from Issue where (State = 'Active') order by Title") <-- returns quite a few results. For what I'm doing I only want the first 5 results.

Using a query like "Select TOP 5 ID, Title from Issue where (State = 'Active') order by Title" results in a "Expecting end of string. The error is caused by «5». " error.

A: 

I think you may be out of luck with WIQL in this case. A couple things come to mind-- you could do a database query against the TFSWorkItemTracking database, or you could use another limiting factor (last updated date, create date, etc.).

Robaticus