diff --git a/x-pack/plugins/alerts/server/task_runner/task_runner.ts b/x-pack/plugins/alerts/server/task_runner/task_runner.ts index 1d39cef7a74ac..c19e967e25e81 100644 --- a/x-pack/plugins/alerts/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerts/server/task_runner/task_runner.ts @@ -231,7 +231,7 @@ export class TaskRunner { alertInstances, executionHandler, originalAlertInstanceIds, - currentAlertInstanceIds + instancesWithScheduledActions ); generateNewAndResolvedInstanceEvents({ @@ -464,8 +464,9 @@ function scheduleActionsForResolvedInstances( }, executionHandler: ReturnType, originalAlertInstanceIds: string[], - currentAlertInstanceIds: string[] + currentAlertInstances: Dictionary ) { + const currentAlertInstanceIds = Object.keys(currentAlertInstances); const resolvedIds = without(originalAlertInstanceIds, ...currentAlertInstanceIds); for (const id of resolvedIds) { alertInstancesMap[id].updateLastScheduledActions(ResolvedActionGroup.id);