Skip to content

[Scripts][Automations] Target saved device groups (incl. dynamic groups) from the Run Script modal and automation definitions #5237

Description

@ToddHebebrand

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:

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions