How to: Add, Remove, and Sort Columns in Query Results

When you run a query, you can choose how the results you receive are displayed in the Query Results.

Note

ID and Title are the only default columns for all work item types.

Required Permissions

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. For more information, see Team Foundation Server Permissions.

To add columns to the Query Results

  1. Open or create a work item query.

  2. On the query toolbar, click Column Options, or right-click anywhere in the Query Results, and click Column Options.

  3. On the Fields tab, under Available columns, select the field you want to add.

  4. Click the > (add) button.

  5. Click the up or down arrow buttons to set the order of the columns in the Selected columns list. This order corresponds to the order that they display in the Results list from left (up) to right (down).

  6. Click OK.

To remove columns from the Query Results

  1. Open or create a work item query.

  2. Right-click anywhere in the Query Results and click Column Options.

  3. On the Fields tab, under Selected columns, select the field you want to remove.

  4. Click the < (remove) button.

  5. Click OK.

To sort by a single column in the Query Results

  1. Open or create a work item query.

  2. In the Query Results, click the column on which you want to sort. You can click the column again to change the sorting order from ascending to descending and back.

To sort by multiple columns in the Results list

  1. Open or create a work item query.

  2. On the query toolbar, click Column Options, or right-click anywhere in the Query Results, and click Column Options.

  3. Click the Sorting tab.

  4. Under Available columns, click a field that by which you want to sort.

  5. Clickthe > (add) button.

    The field or fields are added under Selected columns.

  6. Select each field, and then click the Sort ascending or Sort descending buttons to choose the sort direction.

  7. Click the Move up or Move down buttons to control which fields are sorted first.

  8. Click OK.

See Also

Tasks

How to: Add New Work Item Queries

How to: Run Work Item Queries