Create a query by using the Query editor and Display editor

You can create a query in two ways. You can use the Query editor and Display editor to specify the filter criteria and fields to display, or you can use the Query Wizard. To create a query by using the Query editor and Display editor:
  1. Click Query and clear Use Query Wizard.
  2. Click Query > New Query.
  3. Select Defect in the Choose Record Type window, and click OK.
  4. Click the Display editor tab.
  5. You can specify which fields from the Defect record type appear in the query results and how they should appear. To select a field to display, double-click it in the Fields pane or drag it from the Fields pane to the Display Fields grid. Select the following fields to display:
    • Headline
    • id
    • Owner
    • Project
    • Severity
    • State
    Use the Sort Order column to specify the order in which to display the query results. Enter numbers in the Sort Order cells as follows:
    • Severity 1
    • State 2
    • Owner 3
    • id 4
    • Project 5
    • Headline 6
    You can specify an ascending or descending sort order. Click the Sort cell for each display field once to set the ascending sort order. Click Next.
  6. Click the Query editor tab. You can specify which fields to use as filters when establishing the selection criteria for the query.
  7. Specify the filters and selection criteria:
    1. Double-click the State field in the Fields pane. The State field appears in the Filters pane, and the Filter window opens.
    2. Be sure that Define Filter is selected.
    3. Select Equal from the Operator list.
    4. Click Values. In the Select Values window, select Submitted and click OK.
    5. Double-click the Severity field in the Fields pane.
    6. In the Filter window click Values. In the Select Values window select 1-Critical and 2-Major, and click OK. The query is now defined to return all records that are in the Submitted state with a severity level of critical or major.
  8. Run the query by clicking Run Query from the toolbar.
  9. Examine the records that the query returns in the Results grid.
  10. Click File > Save as. Enter SubmittedCriticalMajor in the Query Name field, and click OK to save the query in the Personal Queries folder of your workspace.