From 71b81e4fd60065c839251dad852d7ff70ca8e2d2 Mon Sep 17 00:00:00 2001 From: Viduni Wickramarachchi Date: Tue, 10 Dec 2024 16:30:27 -0500 Subject: [PATCH] [Obs AI Assistant] Fix alerts function (#203458) --- .../server/functions/alerts.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts index 5408dbbf4ab4f..bf797bb170606 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts @@ -196,17 +196,17 @@ export function registerAlertsFunction({ lte: end, }, }, - ...kqlQuery, - ...(!includeRecovered - ? [ - { - term: { - [ALERT_STATUS]: ALERT_STATUS_ACTIVE, - }, - }, - ] - : []), }, + ...kqlQuery, + ...(!includeRecovered + ? [ + { + term: { + [ALERT_STATUS]: ALERT_STATUS_ACTIVE, + }, + }, + ] + : []), ], }, },