From 2b8d1a67b314a9973035f94ff46f61f0233bc51b Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Wed, 15 Jul 2026 23:26:44 +0530 Subject: [PATCH] fix(automations): preserve actions when a delay resets invalid conditions Enabling a delay on a rule with delay-unsafe conditions called onEventChange, which resets conditions AND actions to defaults, silently replacing the user's configured actions with assign_agent. Reset only the conditions (getDefaultConditions) and leave the actions intact. --- .../dashboard/settings/automation/AutomationRuleForm.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleForm.vue b/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleForm.vue index 4d9c3408d..4f216e2a6 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleForm.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/AutomationRuleForm.vue @@ -11,6 +11,7 @@ import Dialog from 'dashboard/components-next/dialog/Dialog.vue'; import { generateAutomationPayload, getAttributes, + getDefaultConditions, getFileName, showActionInput, } from 'dashboard/helper/automationHelper'; @@ -276,12 +277,14 @@ watch([isDelayed, delayInMinutes], () => { : null; }); -// Turning on a delay narrows the condition options; reset conditions the delayed rule can't use -// (e.g. a mutable attribute) to the event default. Valid selections (incl. an edit) are kept. +// Turning on a delay narrows the condition options; reset only the conditions a delayed rule +// can't use (e.g. a mutable attribute) to the event default. Actions and valid selections are kept. watch(isDelayed, delayed => { if (!delayed || !automation.value) return; if (!isDelaySupported.value) { - props.onEventChange(); + automation.value.conditions = getDefaultConditions( + automation.value.event_name + ); } });