Skip to Main Content
Professional Team Foundation Server
book

Professional Team Foundation Server

by Jean-Luc David, Erik Gunvaldson, Mickey Gousset
November 2006
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 16m
English
Wrox
Content preview from Professional Team Foundation Server

11.5. Using Work Item Query Language

As mentioned earlier, work items have their own query language, called the Work Item Query Language (WIQL). This language is a SQL-like construct that, when used in conjunction with the work item tracking object model, can be used to build powerful queries that retrieve detailed information from the work item tracking system.

This section will give you a brief primer on the Work Item Query Language. For all the details, you should check out the documentation provided in the Visual Studio SDK. For this brief primer, you will learn about the different aspects of a WIQL query, and then see a short application that uses a WIQL query.

Every WIQL query consists of a SELECT statement, containing the fields to retrieve, and a WHERE statement to help determine what information to retrieve. So a sample query to retrieve all the work item ids assigned to Developer1 might look like this:

System.ID from workitems where System.AssignedTo = 'Developer1'

You always must specify the fields you are interested in. When specifying fields, you can use either the friendly name or the reference name. In the above example, we have used the reference name. Best practices dictate that you use reference names at all times, as these will never change, while friendly names may change at some point in the future. You can select any field type in a query, except for plain text fields. And all your standard operators, such as =, >, and <, work in the WHERE clause section. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Visual Studio® 2008

Professional Visual Studio® 2008

Nick Randolph, David Gardner

Publisher Resources

ISBN: 9780471919308Purchase book