Creating a query

Use a query to retrieve a set of work items that meet specific conditions.
About this task
When you create a query, you specify the conditions and the work item properties to display in the results table. You can create the query for your own use or for shared use among team members.
  1. In the Team Artifacts view of the Work Items perspective, expand the project area. Right-click Work Items and select New > Query. Alternatively, you can create a query from within the Work Items view by clicking the Create New Query icon. You can also click File > New > Work Item Query.
  2. In the query editor enter a name for the query in the Name field. Click one of the following links based on the type of query you want to create:
    • Start from scratch. Use this to create a query based on a unique set of conditions. Click the Add Conditions icon. In the Add Conditions window, select the attributes that you want to use as query conditions. Click OK. For each attribute specify the value or condition that must be met. For example, for the Due Date attribute you can use a specific date or a relative date, such as 15 days from now. You can also nest conditions and groups of conditions by clicking the arrow icon next to the Add Condition icon and selecting the type of condition to add. For each group, click All must match and select AND or OR. Use AND when all of the conditions you specify must be met for the query to return a work item. Use OR when any one of the conditions must be met.
    • Simple Query. Use this to create a query that uses Status, Category, Owner, and optional text conditions. Select one or more values for the Status, Category, and Owner attributes. Optionally enter a text string; the query searches fields of the work items for matching occurrences of the text string. Queries for string-based fields, such as Summary and Description, are case-insensitive. Add and remove conditions as necessary.
    • Full Text Query. Use this to create a query that searches all fields of work items for a matching text string. Enter the text string. Add and remove conditions as necessary. Queries for string-based fields, such as Summary and Description, are case-insensitive.
  3. Click the Details tab. Enter a description of the query so that other users can understand what work items the query returns without having to read the Conditions tab. By default, new queries are private. To share a query with members of a team, click Add Team Area and select a team. To share a query with a specific user, click Add User and select the user.
  4. Click the Result Layout tab. In the Result Columns section, double-click each attribute you want to appear as a column heading in the query results grid. Scroll down to the Sorting area. Double-click the attribute to use for sorting the work items in the query results grid. You can set the sort direction to Ascending or Descending in the Selected sort columns table. The first attribute you select is the primary sorting attribute. You can specify additional sorting attributes.
  5. Click Save to save the query.

    Another way to create a query is to edit an existing query. When you finish making changes, click Save Copy and provide a different name for the query.

  6. To run the query, click the Run icon.
  7. To create a feed for this query, click the Create RSS Subscription for this Query icon. You then receive notifications in the Team Central view of any changes to work items selected by this query.
Results
If you do not share the query, or if you share it with a user, it appears in your My Queries folder. If you share the query with a user, the query also shows up in Shared Queries > Individually Shared folder in that user's Jazz™ client. If you share the query with a team, it shows up in the team area folder in the Shared Queries folder.

Feedback

Did this help? You can provide feedback at Jazz.net (registration required): Comment in the forums or submit a bug