Skip to content

[One Workflow] Add alert state checkbox UI for workflow connector#259770

Merged
talboren merged 8 commits intoelastic:mainfrom
talboren:feature/alert-states-ui
Apr 14, 2026
Merged

[One Workflow] Add alert state checkbox UI for workflow connector#259770
talboren merged 8 commits intoelastic:mainfrom
talboren:feature/alert-states-ui

Conversation

@talboren
Copy link
Copy Markdown
Contributor

Summary

Adds a "Run workflow for" checkbox group (New / Ongoing / Recovered alerts) to the workflow connector rule action form, allowing users to configure which alert states trigger workflow execution.

This is the second part of the intermediate release for alertStates support:

Changes

Background

The original PR #256289 included both backend and UI changes but was closed to follow the intermediate release pattern for serverless. The backend changes landed first in #257363, and this PR completes the feature by enabling the UI.

References

Closes elastic/security-team#16239

Made with Cursor

Add the UI portion of the alertStates feature — a "Run workflow for"
checkbox group (New / Ongoing / Recovered alerts) in the rule action
form, between the workflow selector and the action frequency switch.

This is the second part of the intermediate release for elastic#257363:
- Part 1 (merged): backend schema + adapter logic (elastic#257363)
- Part 2 (this PR): UI to set alertStates on rule actions

- Add AlertStates type and alertStates? to public WorkflowsActionParams
- Render EuiCheckboxGroup with New/Ongoing/Recovered options
- Use single editAction call in useEffect for initialization
  (addresses Copilot review feedback from elastic#256289)
- Use "New alerts" terminology (not "Firing") per review feedback
- Add 6 new tests for checkbox rendering, defaults, and toggling

Closes elastic/security-team#16239

Made-with: Cursor
@talboren talboren requested a review from a team as a code owner March 26, 2026 12:43
@talboren talboren added release_note:enhancement backport:skip This PR does not require backporting Team:One Workflow Team label for One Workflow (Workflow automation) release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Mar 26, 2026
@talboren talboren requested a review from Copilot March 26, 2026 13:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds UI support in the workflow connector action form for configuring which alert states trigger workflow execution via an alertStates checkbox group.

Changes:

  • Introduces AlertStates and adds optional alertStates to WorkflowsActionParams
  • Renders an EuiCheckboxGroup for New/Ongoing/Recovered alert states and wires it to editAction
  • Extends tests to cover rendering, defaults, toggling, and initialization behavior for alertStates

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/platform/plugins/shared/workflows_management/public/connectors/workflows/workflows_params.tsx Adds alert state checkbox UI, defaulting/initialization logic, and wiring to action params
src/platform/plugins/shared/workflows_management/public/connectors/workflows/workflows_params.test.tsx Adds/updates tests to validate alertStates defaults, rendering, and updates
src/platform/plugins/shared/workflows_management/public/connectors/workflows/types.ts Extends public action params type with AlertStates / alertStates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

talboren and others added 7 commits March 29, 2026 10:55
- Replace AlertStates interface with AlertStateId union + Record type,
  removing the string index signature (@semd, Copilot)
- Add normalizeAlertStates helper to merge partial states with defaults,
  handling cases where alertStates exists but is missing keys (Copilot)
- Add hidden legend prop to EuiCheckboxGroup for accessibility (Copilot)
- Remove unnecessary useMemo for idToSelectedMap, use alertStates
  directly (@semd)
- Type optionId as AlertStateId in handleAlertStateChange (Copilot)

Made-with: Cursor
Security detection rules (siem.*) only generate new alerts and don't
have ongoing/recovered states. Hide the "Run workflow for" checkbox
group when ruleTypeId starts with 'siem.' since the setting is not
applicable.

Per feedback from @semd and @marshall.main

Made-with: Cursor
Replace the inline `siem.` prefix check with the canonical
`isSiemRuleType` helper, which also covers attack-discovery rules.

Made-with: Cursor
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
workflowsManagement 2.2MB 2.2MB +2.2KB

History

Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@talboren talboren merged commit 7ce0b45 into elastic:main Apr 14, 2026
12 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Apr 14, 2026
* commit '11ed3645c5ededae2a6e29f2a79b31f52208b441': (157 commits)
  remove sync register uiAction methods (elastic#254590)
  [performance] Apply minimal auth to the search route (elastic#257497)
  [ES|QL] Reports correctly the controls server side errors (elastic#263020)
  [SecuritySolution][Navigation] Enable classic nav updates (elastic#262358)
  [Inference] Use pretty name and logo on feature settings page (elastic#262531)
  [Security Solution] fix AT-AB cypress test (elastic#262991)
  [SigEvents] Seed sigevents env script (elastic#261172)
  Adjust conditions for validating no refetch for expanded row (elastic#262978)
  [Agent Builder] update copy for the announcement modal (elastic#263034)
  [Search] Hide index management links for users without privileges (elastic#262627)
  Simplify OAS schema for GET `/api/spaces/space` query params (elastic#260831)
  Fix fleet output OAS regressions: SSL type explosion and Kafka union wrappers (elastic#260842)
  [Dashboards in chat] fix agent confusing the axes in a horizontal chat (elastic#263064)
  [One Workflow] Add alert state checkbox UI for workflow connector (elastic#259770)
  [One Workflow] Deprecate legacy Cases step types in workflow authoring (elastic#262070)
  skip failing test suite (elastic#248090)
  fix flaky test: MonitorDetails filter apply button not enabled (elastic#260788)
  fix: propagate AbortSignal to executeAsReasoningAgent for task cancellation (elastic#262811)
  [Security Solution][Alert KPI] Fix white space bug in alert KPIs (elastic#260803)
  [Streams] Move helpers and format_size_unit to utils folder (elastic#262550)
  ...

# Conflicts:
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/dashboard_canvas_content.test.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/dashboard_canvas_content.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/use_register_canvas_action_buttons.ts
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/index.test.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation) v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants