Skip to content

[Cases] Update cases api docs#256805

Merged
christineweng merged 6 commits into
elastic:mainfrom
christineweng:cases-api-doc-fix
Mar 16, 2026
Merged

[Cases] Update cases api docs#256805
christineweng merged 6 commits into
elastic:mainfrom
christineweng:cases-api-doc-fix

Conversation

@christineweng
Copy link
Copy Markdown
Contributor

@christineweng christineweng commented Mar 9, 2026

Summary

Updated cases API docs to address:

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@christineweng christineweng self-assigned this Mar 9, 2026
@christineweng christineweng requested a review from a team as a code owner March 9, 2026 22:25
@christineweng christineweng added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Cases Security Solution Cases team labels Mar 9, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Comment thread x-pack/platform/plugins/shared/cases/server/routes/api/cases/get_case.ts Outdated
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner March 9, 2026 22:44
- cases
parameters:
- $ref: '../components/parameters/case_id.yaml'
- $ref: '../components/parameters/includeComments.yaml'
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.

It seems like this file can be removed as well then. There are a bunch of references to includeComments in the cases codebase. It would make sense to clean those up as well. I think the workflow examples might also contain references to this option.

Copy link
Copy Markdown
Contributor Author

@christineweng christineweng Mar 10, 2026

Choose a reason for hiding this comment

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

I removed the schema, but includeComments are being used in resolve case, which then passes the case data to case view. Will consider a refactor to move the attachment fetch out of resolve case, and call it explicitly when attachments are needed -> added an item in https://github.com/elastic/security-team/issues/15066

const response = await KibanaServices.get().http.fetch<CaseResolveResponse>(
`${getCaseDetailsUrl(caseId)}/resolve`,
{
method: 'GET',
query: { includeComments: true },
signal,

Copy link
Copy Markdown
Contributor Author

@christineweng christineweng Mar 10, 2026

Choose a reason for hiding this comment

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

I see what you are saying about workflows now, they pulled from public api and I removed the references in 4512bf5

AB however directly calls cases client, so technically it could pass includeComments=true and it will return a case with comments. wdyt?

const theCase = await casesClient.cases.get({
id: caseId,
includeComments,
});

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.

I think includeComments has been deprecated for some time and they should not send it like this. Might be best to reach out to them and clean this up in a follow-up ticket. Sounds good to you?

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.

Actually,

const theCase = await client.cases.get({
id: input.case_id,
includeComments: input.include_comments,
});
is passing it as well...
I wonder what the reasoning is for deprecating this on get.
In any case, I should add a resolveCase endpoint and deprecate includeComments from the getCase workflow.

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.

Well, includeComments is also deprecated in the resolve endpoint:

/**
* @deprecated since version 8.1.0
*/
includeComments: schema.boolean({ defaultValue: true, meta: { deprecated: true } }),
}),

🤔

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.

I think the instances of this only exist by mistake. I would clean them up, as this field was deprecated.

At the time christos had this in the description of the epic

The Cases UI uses the includeComments query parameter. We would need to update the Cases UI to use the alternative endpoint for the query parameter and extend the internal GET /internal/cases/metrics to return the stats needed by the UI.

And I suspect we just never did the follow-up. Because of that, other usages popped up. +1 on cleaning up.

@christineweng christineweng force-pushed the cases-api-doc-fix branch 2 times, most recently from c78a46a to 4512bf5 Compare March 10, 2026 16:49
@christineweng christineweng requested a review from a team as a code owner March 10, 2026 16:49
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Mar 10, 2026
@christineweng christineweng requested a review from adcoelho March 10, 2026 17:13
Copy link
Copy Markdown
Member

@nastasha-solomon nastasha-solomon left a comment

Choose a reason for hiding this comment

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

Just had one question. Otherwise, looks good!

extractObservables:
description: Auto extracts observables
description: |
When true, observables (e.g. IPs, hashes, URLs) are automatically extracted from case comments. Optional; defaults to false when omitted.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How's the "optional" qualification being used in the second sentence?

Also, if the default configuration for this param is false, just need this small tweak:

Suggested change
When true, observables (e.g. IPs, hashes, URLs) are automatically extracted from case comments. Optional; defaults to false when omitted.
When `true`, observables (for example, IPs, hashes, URLs) are automatically extracted from case comments. Defaults to `false` if omitted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Optional means we still accept a request without extractObservables.

Copy link
Copy Markdown
Contributor

@janmonschke janmonschke left a comment

Choose a reason for hiding this comment

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

Changes look good to me! Maybe add a follow-up ticket for cleaning up the usage of includeComments.

@christineweng
Copy link
Copy Markdown
Contributor Author

christineweng commented Mar 13, 2026

Changes look good to me! Maybe add a follow-up ticket for cleaning up the usage of includeComments.

@janmonschke I updated an existing ticket on this -> #207797 and moved it to Todo on our board

Copy link
Copy Markdown
Contributor

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

lgtm

@christineweng christineweng merged commit c80ad6a into elastic:main Mar 16, 2026
15 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout: [ security / entity_store ] plugin / local-serverless-security_complete - Entity Store Main logs extraction - Should extract properly extract host
  • [job] [logs] Scout: [ platform / streams_app-stateful-classic ] plugin / local-stateful-classic - Stream data quality - should open and close degraded field flyout

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
cases 2.0MB 2.0MB +721.0B
workflowsManagement 1.8MB 1.8MB -231.0B
total +490.0B

History

cc @christineweng

sorenlouv pushed a commit that referenced this pull request Mar 17, 2026
## Summary

Updated cases API docs to address:

- Removed alert reference in find comment api. Related:
#156863
- Updated response schema and examples - existing response uses full
case response, which is not correct
- Removed `includeComment` param in get case api. [it is always false
for public
api](https://github.com/elastic/kibana/blob/ab858f5d9f3f91104b083c5b6d31363e41804828/x-pack/platform/plugins/shared/cases/server/routes/api/cases/get_case.ts#L40-L42)
but the response example contains comments, related:
#207739
- Included `extractObservables` to case request and response
- Fixed typos

### Checklist


- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 18, 2026
## Summary

Updated cases API docs to address:

- Removed alert reference in find comment api. Related:
elastic#156863
- Updated response schema and examples - existing response uses full
case response, which is not correct
- Removed `includeComment` param in get case api. [it is always false
for public
api](https://github.com/elastic/kibana/blob/ab858f5d9f3f91104b083c5b6d31363e41804828/x-pack/platform/plugins/shared/cases/server/routes/api/cases/get_case.ts#L40-L42)
but the response example contains comments, related:
elastic#207739
- Included `extractObservables` to case request and response
- Fixed typos

### Checklist


- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
## Summary

Updated cases API docs to address:

- Removed alert reference in find comment api. Related:
elastic#156863
- Updated response schema and examples - existing response uses full
case response, which is not correct
- Removed `includeComment` param in get case api. [it is always false
for public
api](https://github.com/elastic/kibana/blob/ab858f5d9f3f91104b083c5b6d31363e41804828/x-pack/platform/plugins/shared/cases/server/routes/api/cases/get_case.ts#L40-L42)
but the response example contains comments, related:
elastic#207739
- Included `extractObservables` to case request and response
- Fixed typos

### Checklist


- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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: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.