From 6ba3cceb7966be0645c82077d60a4c789e34bf24 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 19 Jan 2023 16:52:52 +0000 Subject: [PATCH] [v9.3.x] Alerting: Fix QueryAndExpressionStep not using the right query (#61796) Alerting: Fix QueryAndExpressionStep not using the right query (#61738) Fix QueryAndExpressionStep not using the right query (cherry picked from commit a6102105afd839088509353131ca45c522c53364) Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> --- .../query-and-alert-condition/QueryAndExpressionsStep.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx index 4f2dfc38aac..34777d9846c 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx @@ -67,8 +67,8 @@ export const QueryAndExpressionsStep: FC = ({ editingExistingRule }) => { }, []); const runQueries = useCallback(() => { - runner.current.run(queries); - }, [queries]); + runner.current.run(getValues('queries')); + }, [getValues]); // whenever we update the queries we have to update the form too useEffect(() => {