Get open, high-severity defects associated with any application module
The following flow demonstrates how to get a list of defects that are associated with an application module (product area), that are open, and have high severity.
Entity relationship diagram
You need to access the following entities for this flow, and understand the relationships between these entities.
Entity | Relationships in this flow | Description of relationship | Reference / relationship fields |
---|---|---|---|
Defect | Product Area | A defect can be associated with 0 or more application modules (product areas). | product_areas |
Phase | A defect is always associated with one phase, such as Opened | phase | |
List Node | A defect can have a severity status. The severity status is stored as a list node. | priority |
Flow
Let's create the REST API calls step-by-step.
-
We can start by listing all the defects in the workspace.
GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects
-
Let's build our query_clause.
This query has three sets of criteria: The phase, the severity, and the application modules (product areas). We will separate each set with a semi-colon (;), which represents the And operator.
In this step, we are only interested in defects that are assigned to any application module (product area). If a defect is not assigned to an application module, we do not want it listed. We use the asterisk (*) wildcard—and only the *—to indicate that we only want to list those defects that have any application module assigned to it.
GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects?query="product_areas EQ {name EQ ^*^}"
-
We also want to query for opened defects. phase is a reference field. We compare the phase's logical_name field to the phase.defect list for a match.
GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects?query="product_areas EQ {name EQ ^*^}; phase EQ {logical_name EQ ^phase.defect.opened^}"
-
Now we query for high severity priorities. priority is a reference field that refers to list_nodes. We compare the priority's logical_name field to the list_node.severity list for a match.
GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects?query="product_areas EQ {name EQ ^*^};phase EQ {logical_name EQ ^phase.defect.opened^};priority EQ {logical_name EQ ^list_node.severity.high^}"
The complete REST API call for this flow is:
GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects?query="product_areas EQ {name EQ ^*^};phase EQ {logical_name EQ ^phase.defect.opened^};priority EQ {logical_name EQ ^list_node.severity.high^}"
See also: