|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Add New Work Item Queries
To find the specific work items that you need to complete your work, you can create a query in Query Builder. For more information on queries, see.
To perform these procedures, you must be a member of the Readers group or have the View work items in this node permission set to Allow. To save a query as a team query, you must be a member of the Project Administrators group. For more information, see.
To add new work item queries to your team project
Open your team project, expand the Work Items node, and then select Team Queries or My Queries.
On the Team menu, click Add Query. A new query opens.
Choose Click here to add a clause to add a new clause to your query.
Click each column in the query clause to fill in the clause. If a column has a list of accepted values, a drop-down arrow appears when the column is selected. Click the drop-down arrow to select from the list. The following columns are available.
Query Column How to complete
Select And if this clause and the previous clause must be true to match a result. Select Or if either this clause or the previous clause must be true to match a result.
The list for this field contains all of the searchable work item fields used in the current Team Foundation Server. Use as many clauses and fields as you need to get useful results. Press ALT+DOWN ARROW or type the field name that you want to choose.
Examples of operator choices are = (equal), <> (not equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), In, Was Ever, Was Never, and Contains.
Specifies the value that you are looking for in the specified field. If there is a list of values to choose from, click the drop-down arrow to select the one that you want. Team Foundation work item tracking includes some query variables to dynamically add values to your query. For more information, see.
Repeat steps 3 and 4 to add all of the values for which you want to search.
On the query toolbar, click Run Query to run the query.
Examine the query results and change your query as needed. You might want to sort the query results to make it easier to find your data. For more information, see.
You should also save your query. For more information, see.