Skip to content

[Cases] Add cases workflow steps#253119

Merged
janmonschke merged 43 commits intoelastic:mainfrom
janmonschke:cases/workflow-steps
Feb 27, 2026
Merged

[Cases] Add cases workflow steps#253119
janmonschke merged 43 commits intoelastic:mainfrom
janmonschke:cases/workflow-steps

Conversation

@janmonschke
Copy link
Copy Markdown
Contributor

@janmonschke janmonschke commented Feb 13, 2026

Summary

image

This PR adds fivefour new enhanced case workflow steps:

  1. cases.createCase: Does not require user to add optional fields, supports adding a connector, better autocompletion
  2. cases.updateCase: Does not require user to specify a version, eliminating the need to fetch the case in the step before. Better autocompletion.
  3. cases.getCase: Gets a case by id
  4. cases.addCaseComment: Adds a comment to a case with better autocompletion
  5. cases.createCaseFromTemplate: Creates a case from an autocompleted case template.

What, 5? I thought it was 4!? Well, yes. Technically there are 5 steps in this PR but only 4 of them are activated. cases.createCaseFromTemplate depends on workflow improvements mentioned in #253568 (namely owner inspection).

Note: all steps also support pushing the case after completion by setting the push-case property to true.

Testing

Add the following to your kibana.dev.yml:

uiSettings:
  overrides:
    bfetch:disableCompression: true
    workflows:ui:enabled: true

I encourage you to check out the code locally and to play around with the workflow feature to get a feel for the autocompletion and how case steps behave. If you notice anything that should be enhanced, add a comment here.

Here's a workflow spec that uses all (enabled) case steps:

Click to reveal yaml file
name: Case workflow kitchen sink
enabled: false
description: Tests all the case stes
triggers:
  - type: manual
steps:
  - name: create_case
    type: cases.createCase
    push-case: true
    connector-id: ba236d8b-67fb-47d6-8df8-bba91381beb1
    with:
      description: "Test description"
      title: "test title"
      owner: securitySolution
      settings:
        syncAlerts: false
  - name: update_case
    type: cases.updateCase
    with:
      case_id: "{{steps.create_case.output.case.id}}"
      updates:
        status: in-progress
        title: The title changed
  - name: add_comment
    type: cases.addComment
    with:
      case_id: "{{steps.update_case.output.case.id}}"
      comment: "Test comment"
  - name: get_case
    type: cases.getCase
    with:
      case_id: "{{steps.add_comment.output.case.id}}"
      include_comments: false

Notes

Reach out to me on Slack for cloud env & connector credentials.

Meta

Depends on: #253568
Partially implements: https://github.com/elastic/security-team/issues/15084
Fixes https://github.com/elastic/security-team/issues/15969

@janmonschke janmonschke added backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:Cases Security Solution Cases team labels Feb 13, 2026
@janmonschke janmonschke added the ci:cloud-deploy Create or update a Cloud deployment label Feb 18, 2026
@janmonschke janmonschke marked this pull request as ready for review February 18, 2026 18:31
@janmonschke janmonschke requested a review from a team as a code owner February 18, 2026 18:31
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-cases (Team:Cases)

@janmonschke janmonschke changed the title [DRAFT][Cases] Add cases workflow steps [Cases] Add cases workflow steps Feb 18, 2026
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner February 18, 2026 18:42
@janmonschke janmonschke requested a review from a team as a code owner February 18, 2026 19:25
@janmonschke
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@christineweng christineweng left a comment

Choose a reason for hiding this comment

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

@janmonschke Great work! Local testing LGTM, left some nit comments on consistency and logging

Comment thread x-pack/platform/plugins/shared/cases/common/workflows/steps/add_comment.ts Outdated
Comment thread x-pack/platform/plugins/shared/cases/server/workflows/steps/create_case.test.ts Outdated
Comment thread x-pack/platform/plugins/shared/cases/server/workflows/steps/utils.ts Outdated
Comment thread x-pack/platform/plugins/shared/cases/server/workflows/steps/utils.test.ts Outdated
Comment thread x-pack/platform/plugins/shared/cases/public/workflows/index.ts
documentation: {
details: i18n.CREATE_CASE_STEP_DOCUMENTATION_DETAILS,
examples: [
`## Basic case creation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

personal nit: can these blobs be extracted to a docs folder somewhere?

Comment thread x-pack/platform/plugins/shared/cases/public/workflows/create_case.tsx Outdated
Comment thread x-pack/platform/plugins/shared/cases/public/workflows/get_case.tsx
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! 🚀

@janmonschke
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@janmonschke janmonschke enabled auto-merge (squash) February 27, 2026 19:36
@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress

History

@janmonschke janmonschke merged commit 1b27634 into elastic:main Feb 27, 2026
16 checks passed
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
## Summary

<img width="1212" height="720" alt="image"
src="https://github.com/user-attachments/assets/59397721-4024-4877-8781-d7736b1d3628"
/>

This PR adds ~~five~~four ~~new~~ enhanced case workflow steps:

1. `cases.createCase`: Does not require user to add optional fields,
supports adding a connector, better autocompletion
2. `cases.updateCase`: Does not require user to specify a `version`,
eliminating the need to fetch the case in the step before. Better
autocompletion.
3. `cases.getCase`: Gets a case by id
4. `cases.addCaseComment`: Adds a comment to a case with better
autocompletion
5. `cases.createCaseFromTemplate`: Creates a case from an autocompleted
case template.

What, 5? I thought it was 4!? Well, yes. Technically there are 5 steps
in this PR but only 4 of them are activated.
`cases.createCaseFromTemplate` depends on workflow improvements
mentioned in elastic#253568 (namely
`owner` inspection).

Note: **all** steps also support pushing the case after completion by
setting the `push-case` property to `true`.

## Testing

Add the following to your `kibana.dev.yml`:

```yml
uiSettings:
  overrides:
    bfetch:disableCompression: true
    workflows:ui:enabled: true
```

I encourage you to check out the code locally and to play around with
the workflow feature to get a feel for the autocompletion and how case
steps behave. If you notice anything that should be enhanced, add a
comment here.

Here's a workflow spec that uses all (enabled) case steps:

<details>
<summary>Click to reveal yaml file</summary>

```yaml
name: Case workflow kitchen sink
enabled: false
description: Tests all the case stes
triggers:
  - type: manual
steps:
  - name: create_case
    type: cases.createCase
    push-case: true
    connector-id: ba236d8b-67fb-47d6-8df8-bba91381beb1
    with:
      description: "Test description"
      title: "test title"
      owner: securitySolution
      settings:
        syncAlerts: false
  - name: update_case
    type: cases.updateCase
    with:
      case_id: "{{steps.create_case.output.case.id}}"
      updates:
        status: in-progress
        title: The title changed
  - name: add_comment
    type: cases.addComment
    with:
      case_id: "{{steps.update_case.output.case.id}}"
      comment: "Test comment"
  - name: get_case
    type: cases.getCase
    with:
      case_id: "{{steps.add_comment.output.case.id}}"
      include_comments: false
```

</details>

## Notes

Reach out to me on Slack for cloud env & connector credentials.

## Meta

Depends on: elastic#253568
Partially implements:
elastic/security-team#15084
Fixes elastic/security-team#15969

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mykhailo Kondrat <247111948+mykhailokondrat@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
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 ci:cloud-deploy Create or update a Cloud deployment release_note:feature Makes this part of the condensed release notes Team:Cases Security Solution Cases team Team:One Workflow Team label for One Workflow (Workflow automation) v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants