Description
Split from #4981. The reporter's underlying request is that one saved device filter is usable everywhere:
Datto has quite powerful device filters, those filters can be used everywhere: policies, jobs (scripts), listing of devices, scheduled tasks etc.
Breeze already has this building block — dynamic device groups (device_groups.type = 'dynamic', filterConditions via filterEngine.ts, including custom.<key> contains/notContains for UDF-driven include/exclude such as "DO NOT REBOOT"). Config-policy assignments, patch rings (via assignments), maintenance windows (legacy targetType: 'group'), and software policies can all target a group. Two surfaces cannot:
- Run Script modal (
ScriptExecutionModal.tsx): targets are an explicit device list (executeScriptSchema.deviceIds, max 500). The modal has an ad-hoc Advanced filters builder, but you cannot pick a saved group, and the filter you build cannot be saved as one.
- Automations (
AutomationForm.tsx): no first-class target; scoping is org/partner ownership plus conditions jsonb, where groupId is one filter field among many. A tech expects "run on group X" as a target, not a condition.
Proposed Fix
Affected Files
apps/web/src/components/scripts/ScriptExecutionModal.tsx, apps/api/src/routes/scripts.ts (~L277-315 executeScriptSchema)
apps/web/src/components/automations/AutomationForm.tsx, apps/api/src/services/automationRuntime.ts (target resolution ~L60-83)
apps/api/src/services/filterEngine.ts (reuse; no change expected)
Reported By
stressedout9064 on Discord (#feature-suggestions, 2026-09-04) — split from #4981.
Description
Split from #4981. The reporter's underlying request is that one saved device filter is usable everywhere:
Breeze already has this building block — dynamic device groups (
device_groups.type = 'dynamic',filterConditionsviafilterEngine.ts, includingcustom.<key>contains/notContains for UDF-driven include/exclude such as "DO NOT REBOOT"). Config-policy assignments, patch rings (via assignments), maintenance windows (legacytargetType: 'group'), and software policies can all target a group. Two surfaces cannot:ScriptExecutionModal.tsx): targets are an explicit device list (executeScriptSchema.deviceIds, max 500). The modal has an ad-hoc Advanced filters builder, but you cannot pick a saved group, and the filter you build cannot be saved as one.AutomationForm.tsx): no first-class target; scoping is org/partner ownership plusconditionsjsonb, wheregroupIdis one filter field among many. A tech expects "run on group X" as a target, not a condition.Proposed Fix
target(all | groupIds[] | deviceIds[]) resolved throughdeviceGroupMembershipsat run time, alongside existing conditions. This also makes the "Jobs / Schedules" reading of automations (see Proposal: unify Service & Process Monitoring + Alerts into one Monitoring & Automation model, with monitor types, triggered actions, and escalation counts #4984) coherent.Affected Files
apps/web/src/components/scripts/ScriptExecutionModal.tsx,apps/api/src/routes/scripts.ts(~L277-315executeScriptSchema)apps/web/src/components/automations/AutomationForm.tsx,apps/api/src/services/automationRuntime.ts(target resolution ~L60-83)apps/api/src/services/filterEngine.ts(reuse; no change expected)Reported By
stressedout9064 on Discord (#feature-suggestions, 2026-09-04) — split from #4981.