Fields (Work Item Query Reference)

In your query, you must always specify fields. This is necessary whether it is for the selected columns, for the sort order, or in the logical expression. Fields can be specified by using either reference names or friendly names in the Work Item Query Language. In either case, you must enclose the field names in square brackets if the filed names include spaces or other non-alphanumeric characters.

Generally, any solution provider building an add-in should use reference names in queries. These remain unchanged even when users change the friendly name for fields.

Selecting Fields

You can select one or more fields in a query. You can select any type of field types except plain text fields.

Here are three SELECT queries with field names.

Using reference name with spaces

SELECT [System.AssignedTo] FROM ...

Using a friendly name with spaces

SELECT [Assigned To] FROM ...

Using names without spaces—no square brackets required

SELECT ID, Title FROM ...

See Also

Other Resources

Syntax for the Work Item Query Language

Work Item Tracking Extensibility