﻿---
title: Cases action steps
description: Reference for the Cases action steps that let workflows create, query, update, attach content, push to external connectors, and manage the lifecycle of cases in any Cases-enabled app.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9661/explore-analyze/workflows/steps/cases
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud Hosted
  - Elastic Cloud Serverless
  - Elastic Cloud on Kubernetes
  - Elastic Documentation
  - Elastic Stack
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.4
---

# Cases action steps
Cases action steps let workflows create, query, update, and manage cases in any Cases-enabled app, including Elastic Security, Observability, and Stack Cases. The `cases.*` namespace provides full coverage of the Cases API through a single, consistent set of step types so you can automate case workflows without leaving the Elastic platform.
Use Cases steps for patterns like:
- Create a case when a detection rule fires, then attach the alert and relevant observables.
- Open a case, assign it to an on-call user, and post a notification to a team channel.
- Find similar cases for deduplication before creating a new one.
- Close a case automatically when a condition is met, and append an analyst note first.


## Shared conventions

Every `cases.*` step shares the same conventions, so once you learn one step the others are predictable.
**Parameter casing.** Case-level parameters use `snake_case`: `case_id`, not `caseId`. The editor rejects camelCase for these fields. (Individual payloads, such as the alert object attached by `cases.addAlerts`, use the casing of the originating API (for example, `alertId`, `index`) because they match external API shapes.)
**Optional `push-case` config.** Many `cases.*` steps accept an optional top-level `push-case` boolean (defaults to `false`). When `true`, the step pushes the updated case to a connected external system (for example, Jira or ServiceNow) after the workflow operation succeeds. Refer to each step's parameters for whether `push-case` is supported.
```yaml
- name: create_and_push
  type: cases.createCase
  push-case: true
  with:
    title: "Triage required"
    severity: high
```

**Schema convention.** In each schema table on this page, the `Location` column indicates where each parameter sits in the YAML:
- `top level`: Alongside `type` and `name`, at the top of the step or trigger definition.
- ``with``: Inside the step's `with:` block.
- ``on``: Inside the trigger's `on:` block.

**Getting the case ID.** The response from `cases.createCase` includes the new case ID at `steps.<step_name>.output.case.id`. Reference it in subsequent steps:
```yaml
- name: new_case
  type: cases.createCase
  with:
    title: "..."

- name: tag_case
  type: cases.addTags
  with:
    case_id: "{{ steps.new_case.output.case.id }}"
    tags: ["triaged"]
```


## Step catalog

The Cases steps group into seven operational categories. Jump to any step:
**Create, fetch, and search**
[`cases.createCase`](#cases-createcase) ·
[`cases.createCaseFromTemplate`](#cases-createcasefromtemplate) ·
[`cases.getCase`](#cases-getcase) ·
[`cases.getCases`](#cases-getcases) ·
[`cases.findCases`](#cases-findcases) ·
[`cases.findSimilarCases`](#cases-findsimilarcases) ·
[`cases.getCasesByAlertId`](#cases-getcasesbyalertid)
**Update fields**
[`cases.updateCase`](#cases-updatecase) ·
[`cases.updateCases`](#cases-updatecases) ·
[`cases.setStatus`](#cases-setstatus) ·
[`cases.setSeverity`](#cases-setseverity) ·
[`cases.setTitle`](#cases-settitle) ·
[`cases.setDescription`](#cases-setdescription) ·
[`cases.setCategory`](#cases-setcategory) ·
[`cases.setCustomField`](#cases-setcustomfield) ·
[`cases.setExtendedFields`](#cases-setextendedfields) ·
[`cases.closeCase`](#cases-closecase)
**Attach content**
[`cases.addComment`](#cases-addcomment) ·
[`cases.addAlerts`](#cases-addalerts) ·
[`cases.addEvents`](#cases-addevents) ·
[`cases.addObservables`](#cases-addobservables) ·
[`cases.addAttachments`](#cases-addattachments) ·
[`cases.getAllAttachments`](#cases-getallattachments) ·
[`cases.deleteAttachments`](#cases-deleteattachments)
**Tags and assignees**
[`cases.addTags`](#cases-addtags) ·
[`cases.removeTags`](#cases-removetags) ·
[`cases.assignCase`](#cases-assigncase) ·
[`cases.unassignCase`](#cases-unassigncase)
**Update and delete observables**
[`cases.updateObservable`](#cases-updateobservable) ·
[`cases.deleteObservable`](#cases-deleteobservable)
**Push to external connector**
[`cases.pushCases`](#cases-pushcases)
**Delete**
[`cases.deleteCases`](#cases-deletecases)
---


## Create, fetch, and search


### `cases.createCase`

Create a case with a title, description, severity, tags, and optional assignees. Accepts an optional top-level `connector-id` to associate the case with a configured external connector (for example, Jira or ServiceNow).

| Parameter         | Location  | Type       | Required | Description                                                                                                                                                                                                                                                                                                                                                                          |
|-------------------|-----------|------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `connector-id`    | top level | string     | No       | ID of a configured external connector to attach to the case.                                                                                                                                                                                                                                                                                                                         |
| `title`           | `with`    | string     | Yes      | Case title.                                                                                                                                                                                                                                                                                                                                                                          |
| `description`     | `with`    | string     | Yes      | Case description. Markdown supported.                                                                                                                                                                                                                                                                                                                                                |
| `owner`           | `with`    | string     | Yes      | Case owner: `securitySolution`, `observability`, or `cases`.                                                                                                                                                                                                                                                                                                                         |
| `severity`        | `with`    | string     | No       | `low`, `medium`, `high`, or `critical`.                                                                                                                                                                                                                                                                                                                                              |
| `tags`            | `with`    | `string[]` | No       | Tags to apply to the case.                                                                                                                                                                                                                                                                                                                                                           |
| `assignees`       | `with`    | array      | No       | Array of `{ uid }` objects.                                                                                                                                                                                                                                                                                                                                                          |
| `category`        | `with`    | string     | No       | Case category.                                                                                                                                                                                                                                                                                                                                                                       |
| `extended_fields` | `with`    | object     | No       | <applies-to>Elastic Stack: Generally available since 9.5</applies-to> Map of extended field storage key to string value, for example `priority_as_keyword: "high"`. Keys follow the `<name>_as_<type>` convention. Discover them with the [get the fields applicable to a case API](https://www.elastic.co/docs/api/doc/kibana/operation/operation-getapplicablefieldsdefaultspace). |
| `customFields`    | `with`    | array      | No       | <applies-to>Elastic Cloud Serverless: Deprecated</applies-to> <applies-to>Elastic Stack: Planned for deprecation</applies-to> Use `extended_fields` instead. Custom field values.                                                                                                                                                                                                    |
| `settings`        | `with`    | object     | No       | Case settings, for example `syncAlerts`.                                                                                                                                                                                                                                                                                                                                             |

```yaml
- name: create_case
  type: cases.createCase
  with:
    title: "{{ event.rule.name }} on {{ event.alerts[0].host.name }}"
    description: "Automatically created from detection rule."
    severity: high
    tags: ["auto-triage", "malware"]
    owner: "securitySolution"
```


### `cases.createCaseFromTemplate`

Create a case from a configured case template. Useful when a team has pre-defined case shapes (default title, description, tags, severity) for common scenarios.

| Parameter          | Location | Type   | Required | Description                                                            |
|--------------------|----------|--------|----------|------------------------------------------------------------------------|
| `case_template_id` | `with`   | string | Yes      | ID of the template to apply.                                           |
| `overwrites`       | `with`   | object | No       | Fields to override on the templated case, for example `title`, `tags`. |

```yaml
- name: create_from_template
  type: cases.createCaseFromTemplate
  with:
    case_template_id: "malware-triage-template"
    overwrites:
      title: "Malware: {{ event.alerts[0].host.name }}"
```


### `cases.getCase`

Retrieve a complete case object by ID. To retrieve the case's attachments, use [`cases.getAllAttachments`](#cases-getallattachments).

| Parameter          | Location | Type    | Required | Description                                                                                                                                                                                                                                                                                  |
|--------------------|----------|---------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `case_id`          | `with`   | string  | Yes      | Case ID.                                                                                                                                                                                                                                                                                     |
| `include_comments` | `with`   | boolean | No       | <applies-to>Elastic Cloud Serverless: Deprecated</applies-to> <applies-to>Elastic Stack: Deprecated since 9.5</applies-to> Use [`cases.getAllAttachments`](#cases-getallattachments) to retrieve case attachments. When `true`, includes case comments in the response. Defaults to `false`. |

```yaml
- name: fetch_case
  type: cases.getCase
  with:
    case_id: "{{ inputs.case_id }}"
```


### `cases.getCases`

Retrieve up to 1000 cases in a single request. IDs that can't be fetched are reported in the `errors` array on the output. Use this to avoid N sequential `cases.getCase` calls in fan-out workflows.

| Parameter  | Location | Type       | Required | Description                      |
|------------|----------|------------|----------|----------------------------------|
| `case_ids` | `with`   | `string[]` | Yes      | Array of case IDs. Maximum 1000. |

Output: `{ cases: array, errors: array }`. The `errors` array contains entries for any IDs that couldn't be fetched.
```yaml
- name: fetch_cases
  type: cases.getCases
  with:
    case_ids: ["case-1", "case-2", "case-3"]
```


### `cases.findCases`

Search for cases matching filter criteria. Supports paging, sorting, and filtering by many fields.

| Parameter               | Location | Type                 | Required | Description                                                                         |
|-------------------------|----------|----------------------|----------|-------------------------------------------------------------------------------------|
| `search`                | `with`   | string               | No       | Free-text search.                                                                   |
| `searchFields`          | `with`   | `string \| string[]` | No       | Fields to search in.                                                                |
| `defaultSearchOperator` | `with`   | string               | No       | `AND` or `OR` for multi-term search.                                                |
| `status`                | `with`   | `string \| string[]` | No       | Filter by status.                                                                   |
| `severity`              | `with`   | `string \| string[]` | No       | Filter by severity.                                                                 |
| `tags`                  | `with`   | `string \| string[]` | No       | Filter by tag.                                                                      |
| `category`              | `with`   | `string \| string[]` | No       | Filter by category.                                                                 |
| `owner`                 | `with`   | `string \| string[]` | No       | Filter by case owner.                                                               |
| `assignees`             | `with`   | `string \| string[]` | No       | Filter by assignee UID.                                                             |
| `reporters`             | `with`   | `string \| string[]` | No       | Filter by reporter.                                                                 |
| `customFields`          | `with`   | object               | No       | Map of custom-field ID to allowed values.                                           |
| `from`                  | `with`   | string               | No       | Start of the time range.                                                            |
| `to`                    | `with`   | string               | No       | End of the time range.                                                              |
| `page`                  | `with`   | number               | No       | Page number. Defaults to `1`.                                                       |
| `perPage`               | `with`   | number               | No       | Results per page. Defaults to `20`.                                                 |
| `sortField`             | `with`   | string               | No       | `title`, `category`, `createdAt`, `updatedAt`, `closedAt`, `status`, or `severity`. |
| `sortOrder`             | `with`   | string               | No       | `asc` or `desc`.                                                                    |

```yaml
- name: find_open_high_sev
  type: cases.findCases
  with:
    owner: "securitySolution"
    status: "open"
    severity: ["high", "critical"]
    tags: ["investigation"]
    sortField: "updatedAt"
    sortOrder: "desc"
    perPage: 20
```

The output includes a `cases` array plus per-status counts (`count_open_cases`, `count_in_progress_cases`, `count_closed_cases`), `page`, `per_page`, and `total`.

### `cases.findSimilarCases`

Find cases similar to a given case, matched by shared observables. Useful for deduplication before creating a new case.

| Parameter | Location | Type    | Required | Description                               |
|-----------|----------|---------|----------|-------------------------------------------|
| `case_id` | `with`   | string  | Yes      | Source case ID to find similar cases for. |
| `page`    | `with`   | integer | Yes      | Page number (1-based).                    |
| `perPage` | `with`   | integer | Yes      | Results per page.                         |

Output: `{ cases: array, page: integer, per_page: integer, total: integer }`.
```yaml
- name: find_similar
  type: cases.findSimilarCases
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    page: 1
    perPage: 20
```


### `cases.getCasesByAlertId`

Find every case that contains a specific alert. The canonical "does a case already exist for this alert?" query.

| Parameter  | Location | Type   | Required | Description           |
|------------|----------|--------|----------|-----------------------|
| `alert_id` | `with`   | string | Yes      | Alert signal ID.      |
| `owner`    | `with`   | string | No       | Filter by case owner. |

```yaml
- name: check_existing
  type: cases.getCasesByAlertId
  with:
    alert_id: "{{ event.alerts[0]._id }}"
```

---


## Update fields


### `cases.updateCase`

Update one case's fields. Changes go inside a required `updates` object. An optional `version` field enforces optimistic concurrency.

| Parameter | Location | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|-----------|----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `version` | `with`   | string | No       | Case version for optimistic concurrency.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `updates` | `with`   | object | Yes      | Fields to update. At least one field required. Includes `title`, `description`, `status`, `severity`, `category`, `tags`, `assignees`, `settings`, and more.<applies-to>Elastic Stack: Generally available since 9.5</applies-to> `extended_fields`: The step merges the keys you provide into the case's existing extended fields.<applies-to>Elastic Cloud Serverless: Deprecated</applies-to> <applies-to>Elastic Stack: Planned for deprecation</applies-to> `customFields`: Use `extended_fields` instead. |

```yaml
- name: escalate
  type: cases.updateCase
  with:
    case_id: "{{ steps.find.output.cases[0].id }}"
    updates:
      status: "in-progress"
      severity: "critical"
      tags: ["escalated"]
```

<important>
  Update fields must sit inside the `updates` object, not at the top level of `with`. `updates: { status: open }` is valid; `with: { status: open, case_id: ... }` is not.
</important>


### `cases.updateCases`

Bulk-update multiple cases. Each element specifies its own `case_id`, optional `version`, and `updates` object.

| Parameter | Location | Type  | Required | Description                                        |
|-----------|----------|-------|----------|----------------------------------------------------|
| `cases`   | `with`   | array | Yes      | Array of `{ case_id, version?, updates }` objects. |

```yaml
- name: bulk_close
  type: cases.updateCases
  with:
    cases:
      - case_id: "c1"
        updates:
          status: "closed"
      - case_id: "c2"
        updates:
          status: "closed"
```


### `cases.setStatus`

Set a case's status.

| Parameter | Location | Type   | Required | Description                         |
|-----------|----------|--------|----------|-------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                            |
| `status`  | `with`   | string | Yes      | `open`, `in-progress`, or `closed`. |

```yaml
- name: mark_in_progress
  type: cases.setStatus
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    status: "in-progress"
```


### `cases.setSeverity`

Set a case's severity.

| Parameter  | Location | Type   | Required | Description                             |
|------------|----------|--------|----------|-----------------------------------------|
| `case_id`  | `with`   | string | Yes      | Case ID.                                |
| `severity` | `with`   | string | Yes      | `low`, `medium`, `high`, or `critical`. |


### `cases.setTitle`

Update a case's title.

| Parameter | Location | Type   | Required | Description |
|-----------|----------|--------|----------|-------------|
| `case_id` | `with`   | string | Yes      | Case ID.    |
| `title`   | `with`   | string | Yes      | New title.  |


### `cases.setDescription`

Update a case's description.

| Parameter     | Location | Type   | Required | Description                          |
|---------------|----------|--------|----------|--------------------------------------|
| `case_id`     | `with`   | string | Yes      | Case ID.                             |
| `description` | `with`   | string | Yes      | New description. Markdown supported. |


### `cases.setCategory`

Set a case's category.

| Parameter  | Location | Type   | Required | Description                                                               |
|------------|----------|--------|----------|---------------------------------------------------------------------------|
| `case_id`  | `with`   | string | Yes      | Case ID.                                                                  |
| `category` | `with`   | string | Yes      | Category name.                                                            |
| `owner`    | `with`   | string | No       | Case owner. Optional, but providing it helps with editor auto-completion. |


### `cases.setCustomField`

<applies-to>
  - Elastic Cloud Serverless: Deprecated
  - Elastic Stack: Planned for deprecation
</applies-to>

Custom fields are deprecated. Use [`cases.setExtendedFields`](#cases-setextendedfields) instead.
Set a single custom-field value on a case. The `field_name` parameter is the system-set custom-field identifier (a UUID-style string), not the human-readable label you see in the UI.

| Parameter    | Location | Type                          | Required | Description                                                               |
|--------------|----------|-------------------------------|----------|---------------------------------------------------------------------------|
| `case_id`    | `with`   | string                        | Yes      | Case ID.                                                                  |
| `field_name` | `with`   | string                        | Yes      | Custom-field identifier. System-set, typically a UUID.                    |
| `value`      | `with`   | `string \| number \| boolean` | Yes      | Field value.                                                              |
| `owner`      | `with`   | string                        | No       | Case owner. Optional, but providing it helps with editor auto-completion. |
| `version`    | `with`   | string                        | No       | Case version for optimistic concurrency.                                  |

```yaml
- name: set_investigation_owner
  type: cases.setCustomField
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    field_name: "4b8c9d2e-1a5f-4f7a-9c3b-2d6e8f1a3b5c"
    value: "soc-team"
```


### `cases.setExtendedFields`

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.5
</applies-to>

Set one or more extended field values on a case in a single request. The step merges the fields you provide into the case's existing extended fields and leaves unlisted fields unchanged. The server rejects unknown keys and values that don't match the field definition.

| Parameter | Location | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|-----------|----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `fields`  | `with`   | object | Yes      | Map of storage key to string value, for example `priority_as_keyword: "high"`. Keys follow the `<name>_as_<type>` convention. Discover the keys a case accepts with the [get the fields applicable to an existing case API](https://www.elastic.co/docs/api/doc/kibana/operation/operation-getcaseapplicablefieldsdefaultspace). For multi-value controls such as a checkbox group or user picker, pass a JSON-encoded array string. An empty string clears the field. |
| `version` | `with`   | string | No       | Case version for optimistic concurrency.                                                                                                                                                                                                                                                                                                                                                                                                                               |

```yaml
- name: set_priority
  type: cases.setExtendedFields
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    fields:
      priority_as_keyword: "high"
      analyst_notes_as_keyword: "escalated by automation"
```


### `cases.closeCase`

Close a case.

| Parameter | Location | Type   | Required | Description                              |
|-----------|----------|--------|----------|------------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                                 |
| `version` | `with`   | string | No       | Case version for optimistic concurrency. |

```yaml
- name: close_case
  type: cases.closeCase
  with:
    case_id: "{{ steps.find.output.cases[0].id }}"
```

To record why a case was closed, pair with `cases.addComment` beforehand:
```yaml
- name: note_reason
  type: cases.addComment
  with:
    case_id: "{{ inputs.case_id }}"
    comment: "Closing: duplicate of case {{ inputs.duplicate_of }}."

- name: close
  type: cases.closeCase
  with:
    case_id: "{{ inputs.case_id }}"
```

---


## Attach content


### `cases.addComment`

Add a Markdown-formatted comment to a case.

| Parameter | Location | Type   | Required | Description   |
|-----------|----------|--------|----------|---------------|
| `case_id` | `with`   | string | Yes      | Case ID.      |
| `comment` | `with`   | string | Yes      | Comment body. |

```yaml
- name: add_triage_note
  type: cases.addComment
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    comment: |
      AI classification: **{{ steps.classify.output.category }}**

      Rationale: {{ steps.classify.output.rationale }}
```


### `cases.addAlerts`

Attach detection alerts to a case. Each entry is an **object** with `alertId` and `index`. The optional `rule` describes the rule that generated the alert.

| Parameter | Location | Type   | Required | Description                                   |
|-----------|----------|--------|----------|-----------------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                                      |
| `alerts`  | `with`   | array  | Yes      | Array of `{ alertId, index, rule? }` objects. |

```yaml
- name: attach_alert
  type: cases.addAlerts
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    alerts:
      - alertId: "{{ event.alerts[0]._id }}"
        index: "{{ event.alerts[0]._index }}"
        rule:
          id: "{{ event.rule.id }}"
          name: "{{ event.rule.name }}"
```

<important>
  `alerts` takes an array of objects, not an array of ID strings. Each alert object requires both `alertId` and the `index` where the alert document lives. Cases uses both to resolve the alert document.
</important>


### `cases.addEvents`

Attach arbitrary event documents to a case. Each entry is `{ eventId, index }`.

| Parameter | Location | Type   | Required | Description                            |
|-----------|----------|--------|----------|----------------------------------------|
| `case_id` | `with`   | string | Yes      | Case ID.                               |
| `events`  | `with`   | array  | Yes      | Array of `{ eventId, index }` objects. |

```yaml
- name: attach_context_events
  type: cases.addEvents
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    events:
      - eventId: "{{ steps.search_context.output.hits.hits[0]._id }}"
        index: "{{ steps.search_context.output.hits.hits[0]._index }}"
```


### `cases.addObservables`

Add observables (indicators of compromise such as IPs, file hashes, domains, or URLs) to a case. `typeKey` must match one of the built-in observable types in Elastic Security.

| Parameter     | Location | Type   | Required | Description                                          |
|---------------|----------|--------|----------|------------------------------------------------------|
| `case_id`     | `with`   | string | Yes      | Case ID.                                             |
| `observables` | `with`   | array  | Yes      | Array of `{ typeKey, value, description? }` objects. |

```yaml
- name: add_iocs
  type: cases.addObservables
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    observables:
      - typeKey: "observable-type-ipv4"
        value: "{{ event.alerts[0].source.ip }}"
        description: "Source of malicious activity"
      - typeKey: "observable-type-file-hash"
        value: "{{ event.alerts[0].file.hash.sha256 }}"
```

The `typeKey` must match one of the built-in observable type keys: `observable-type-ipv4`, `observable-type-ipv6`, `observable-type-url`, `observable-type-domain`, or `observable-type-file-hash`. Use `observable-type-file-hash` for all hash algorithms (MD5, SHA-1, SHA-256, and so on).

### `cases.addAttachments`

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.5
</applies-to>

Attach one or more items to a case in a single request. Use this when you need to add several attachment types together, such as a comment, an alert, and a dashboard, instead of chaining dedicated steps such as [`cases.addComment`](#cases-addcomment) or [`cases.addAlerts`](#cases-addalerts).
Each entry in `attachments` uses a `type` field that selects the payload shape. Required fields depend on that type (`data`, `attachmentId`, and `metadata` appear only when the type needs them). The YAML editor narrows the available fields after you set `type`. Don't set `owner`. The step injects it from the target case.
Common `type` values include:
- `comment` ([`cases.addComment`](#cases-addcomment))
- `stack.alert`, `security.alert`, `observability.alert` ([`cases.addAlerts`](#cases-addalerts))
- `security.event` ([`cases.addEvents`](#cases-addevents)), `security.endpoint`, `security.indicator`, `security.timeline`
- `osquery`
- `dashboard`, `map`, `discoverSession`
- `lens` (by saved-object reference: `attachmentId` plus `metadata.title` and `metadata.soType: "lens"`)

Which types appear depends on the solutions and plugins enabled in your deployment. Use the example below for the payload shapes this step expects.

| Parameter     | Location | Type   | Required | Description                                                           |
|---------------|----------|--------|----------|-----------------------------------------------------------------------|
| `case_id`     | `with`   | string | Yes      | Case ID.                                                              |
| `attachments` | `with`   | array  | Yes      | Array of `{ type, attachmentId?, data?, metadata? }` objects (1–100). |

Output: `{ case: object }` (the updated case).
```yaml
- name: attach_attachments
  type: cases.addAttachments
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    attachments:
      - type: "comment"
        data:
          content: "Investigating this incident."
      - type: "security.alert"
        attachmentId: "{{ event.alerts[0]._id }}"
        metadata:
          index: "{{ event.alerts[0]._index }}"
          rule:
            id: "{{ event.rule.id }}"
            name: "{{ event.rule.name }}"
      - type: "dashboard"
        attachmentId: "dashboard-id-1"
        metadata:
          title: "Security dashboard"
          soType: "dashboard"
```

<note>
  These attachment types aren't available through this step:
  - File attachments
  - Anomaly charts, anomaly swim lane, and single metric viewer
  - Change point detection, log pattern analysis, and log rate analysis
  - Lens visualizations that include the full visualization state instead of a saved-object reference
  For those, use the dedicated Cases UI flows. You can still attach a Lens visualization by saved-object reference with `type: lens`.
</note>


### `cases.getAllAttachments`

Fetch every attachment associated with a case without pagination. Use this when you need the complete set of attachments for decision-making, for example when checking evidence before closing or escalating.

| Parameter | Location | Type   | Required | Description |
|-----------|----------|--------|----------|-------------|
| `case_id` | `with`   | string | Yes      | Case ID.    |

Output: `{ attachments: array }`.
```yaml
- name: list_attachments
  type: cases.getAllAttachments
  with:
    case_id: "{{ inputs.case_id }}"
```


### `cases.deleteAttachments`

<applies-to>
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Planned
</applies-to>

Delete one or more attachments from a case in a single request. The step checks every ID first. If any attachment isn't on the case, the step fails and deletes nothing. The case activity records each deletion.

| Parameter         | Location | Type       | Required | Description                                                                                                                                                                                                             |
|-------------------|----------|------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `case_id`         | `with`   | string     | Yes      | Case ID.                                                                                                                                                                                                                |
| `ids`             | `with`   | `string[]` | Yes      | Attachment IDs (1–100). Use each attachment's own `id` from [`cases.getAllAttachments`](#cases-getallattachments), not its `attachmentId`, which points to the alert, event, or saved object the attachment references. |
| `include_related` | `with`   | boolean    | No       | Also delete the attachments that the deleted ones brought to the case, such as the alerts of an attack. Defaults to `true`.                                                                                             |

The step returns `{ case_id: string, ids: string[] }`, where `ids` lists the deleted attachment IDs.
```yaml
- name: get_attachments
  type: cases.getAllAttachments
  with:
    case_id: "{{ steps.create_case.output.case.id }}"

- name: delete_oldest_attachment
  type: cases.deleteAttachments
  if: "${{ steps.get_attachments.output.attachments.length > 0 }}"
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    ids:
      - "{{ steps.get_attachments.output.attachments[0].id }}"
```

---


## Tags and assignees


### `cases.addTags`

Add tags to a case.

| Parameter | Location | Type       | Required | Description  |
|-----------|----------|------------|----------|--------------|
| `case_id` | `with`   | string     | Yes      | Case ID.     |
| `tags`    | `with`   | `string[]` | Yes      | Tags to add. |


### `cases.removeTags`

Remove tags from a case. Pass the case ID and the list of tags to remove.

| Parameter | Location | Type       | Required | Description                                                |
|-----------|----------|------------|----------|------------------------------------------------------------|
| `case_id` | `with`   | string     | Yes      | Case ID.                                                   |
| `tags`    | `with`   | `string[]` | Yes      | Tags to remove. Tags that are not on the case are ignored. |

```yaml
- name: remove_case_tags
  type: cases.removeTags
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    tags: ["investigation", "high-priority"]
```


### `cases.assignCase`

Assign a case to one or more users.

| Parameter   | Location | Type   | Required | Description                 |
|-------------|----------|--------|----------|-----------------------------|
| `case_id`   | `with`   | string | Yes      | Case ID.                    |
| `assignees` | `with`   | array  | Yes      | Array of `{ uid }` objects. |

```yaml
- name: assign_oncall
  type: cases.assignCase
  with:
    case_id: "{{ steps.create_case.output.case.id }}"
    assignees:
      - uid: "{{ consts.oncall_uid }}"
```


### `cases.unassignCase`

Remove assignees from a case.

| Parameter   | Location | Type   | Required | Description                                                                                             |
|-------------|----------|--------|----------|---------------------------------------------------------------------------------------------------------|
| `case_id`   | `with`   | string | Yes      | Case ID.                                                                                                |
| `assignees` | `with`   | array  | Yes      | Array of `{ uid }` objects to remove. Pass an empty array (`[]`) to remove all assignees from the case. |

---


## Update and delete observables


### `cases.updateObservable`

Update an existing observable on a case.

| Parameter       | Location | Type             | Required | Description          |
|-----------------|----------|------------------|----------|----------------------|
| `case_id`       | `with`   | string           | Yes      | Case ID.             |
| `observable_id` | `with`   | string           | Yes      | Observable ID.       |
| `value`         | `with`   | string           | Yes      | Updated value.       |
| `description`   | `with`   | `string \| null` | No       | Updated description. |


### `cases.deleteObservable`

Remove an observable from a case.

| Parameter       | Location | Type   | Required | Description    |
|-----------------|----------|--------|----------|----------------|
| `case_id`       | `with`   | string | Yes      | Case ID.       |
| `observable_id` | `with`   | string | Yes      | Observable ID. |

---


## Push to external connector


### `cases.pushCases`

Push one or more cases to their configured external connector. Each case must have a connector configured; the step fails if any case in `case_ids` doesn't have one.

| Parameter  | Location | Type       | Required | Description                                                                    |
|------------|----------|------------|----------|--------------------------------------------------------------------------------|
| `case_ids` | `with`   | `string[]` | Yes      | Array of case IDs to push. Each case must already have a connector configured. |

Output: `{ cases: array }`. Each element is the updated case object returned after the push.
```yaml
- name: push_case
  type: cases.pushCases
  with:
    case_ids:
      - "abc-123-def-456"
```

Push multiple cases in a single step:
```yaml
- name: push_cases
  type: cases.pushCases
  with:
    case_ids:
      - "abc-123-def-456"
      - "ghi-789-jkl-012"
```

---


## Delete


### `cases.deleteCases`

Delete one or more cases permanently, including their attachments and comments.

| Parameter  | Location | Type       | Required | Description                  |
|------------|----------|------------|----------|------------------------------|
| `case_ids` | `with`   | `string[]` | Yes      | Array of case IDs to delete. |

```yaml
- name: cleanup
  type: cases.deleteCases
  with:
    case_ids: ["old-case-1", "old-case-2"]
```

<warning>
  Deleted cases can't be recovered. If you don't want to permanently delete a case, use [`cases.closeCase`](#cases-closecase) instead.
</warning>


## Migrating from `kibana.*` case aliases

In 9.3, case management lived under the `kibana.*` namespace. Those step types remain as deprecated aliases so existing workflows keep running, but new workflows must use `cases.*`:

| Deprecated (9.3 alias)              | Current (9.4)                           |
|-------------------------------------|-----------------------------------------|
| `kibana.createCaseDefaultSpace`     | [`cases.createCase`](#cases-createcase) |
| `kibana.getCaseDefaultSpace`        | [`cases.getCase`](#cases-getcase)       |
| `kibana.updateCaseDefaultSpace`     | [`cases.updateCase`](#cases-updatecase) |
| `kibana.addCaseCommentDefaultSpace` | [`cases.addComment`](#cases-addcomment) |

Refer to [Migrate from 9.3 to 9.4](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9661/explore-analyze/workflows/authoring-techniques/migrate-from-9-3) for side-by-side replacement patterns.

## Related

- [Alert triggers](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9661/explore-analyze/workflows/triggers/alert-triggers): The primary source of cases in a SOC workflow.
- [AI steps](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9661/explore-analyze/workflows/steps/ai-steps): Use an AI classification or summary to enrich a case description.
- [Kibana Cases documentation](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9661/solutions/security/investigate/security-cases): The Cases feature in Elastic Security.