From fbe610ba39da8c6dffa2f164d1e56dcb04481ada Mon Sep 17 00:00:00 2001 From: Raphael Aurich Date: Fri, 13 Sep 2024 19:01:32 +0200 Subject: [PATCH] Group by deploy_id in incidents view --- queries/incidents.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/queries/incidents.sql b/queries/incidents.sql index fe915b3e..2e1fa6b0 100644 --- a/queries/incidents.sql +++ b/queries/incidents.sql @@ -61,6 +61,7 @@ SELECT service_catalog.service, incident_id, root.environment as deployment_environment, + root.deploy_id, MIN(IF(root.time_created < issue.time_created, root.time_created, issue.time_created)) AS time_created, MAX(time_resolved) AS time_resolved, ARRAY_AGG(root_cause IGNORE NULLS) AS changes, @@ -80,7 +81,8 @@ LEFT JOIN ( time_created, changes, service, - environment + environment, + deploy_id FROM `four_keys.deployments` AS d, d.changes @@ -99,6 +101,7 @@ GROUP BY 2, 3, 4, - 5 + 5, + 6 HAVING MAX(bug) IS TRUE ;