diff --git a/public/app/features/alerting/unified/components/rule-editor/util.test.ts b/public/app/features/alerting/unified/components/rule-editor/util.test.ts index 64b24bc9b87..edb7407b3b9 100644 --- a/public/app/features/alerting/unified/components/rule-editor/util.test.ts +++ b/public/app/features/alerting/unified/components/rule-editor/util.test.ts @@ -396,16 +396,6 @@ function createThresholdExample(thresholdType: string): AlertQuery[] { params: [0, 10], type: thresholdType ?? 'gt', }, - operator: { - type: 'and', - }, - query: { - params: ['B'], - }, - reducer: { - params: [], - type: 'last', - }, }, ], expression: 'B', diff --git a/public/app/features/alerting/unified/components/rule-editor/util.ts b/public/app/features/alerting/unified/components/rule-editor/util.ts index 626551539af..8b02e10f153 100644 --- a/public/app/features/alerting/unified/components/rule-editor/util.ts +++ b/public/app/features/alerting/unified/components/rule-editor/util.ts @@ -150,7 +150,7 @@ export function getThresholdsForQueries(queries: AlertQuery[]) { const threshold = condition.evaluator.params; // "classic_conditions" use `condition.query.params[]` and "threshold" uses `query.model.expression` - const refId = condition.query.params[0] ?? query.model.expression; + const refId = condition.query?.params[0] ?? query.model.expression; // if an expression hasn't been linked to a data query yet, it won't have a refId if (!refId) {