Skip to content

[Cases] Rename attachment id to saved object id#259158

Merged
christineweng merged 3 commits intoelastic:mainfrom
christineweng:cases-rename-attachment-id
Mar 26, 2026
Merged

[Cases] Rename attachment id to saved object id#259158
christineweng merged 3 commits intoelastic:mainfrom
christineweng:cases-rename-attachment-id

Conversation

@christineweng
Copy link
Copy Markdown
Contributor

@christineweng christineweng commented Mar 23, 2026

Summary

Before cases v2 change, in the cases code base, attachmentId is used to represent saved object id. With introduction to the V2 schema, attachmentId is used to refer to external document ids, like alert id, event id etc. This PR renamed all the legacy attachmentId to savedObjectId so that it's not confusing for future development.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • 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.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@christineweng christineweng self-assigned this Mar 23, 2026
@christineweng christineweng requested a review from a team as a code owner March 23, 2026 16:13
@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 v9.4.0 labels Mar 23, 2026
@christineweng christineweng force-pushed the cases-rename-attachment-id branch from 8984c93 to 4464f99 Compare March 23, 2026 18:28
message: rt.string,
status: rt.union([rt.undefined, rt.number]),
attachmentId: rt.string,
savedObjectId: rt.string,
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.

bulk get is an internal route - @cnasikas is it alright to update the v1 shape here?

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.

Yes, for internal APIs, it is ok to rename an attribute and not introduce another version of the API. If you have changed what is being persisted on the saved objects (I haven't checked the code), then you would need to handle SOs with attachmentId and SOs with savedObjectId in them.

@lgestc
Copy link
Copy Markdown
Contributor

lgestc commented Mar 25, 2026

thank you for the cleanup:)

@christineweng christineweng enabled auto-merge (squash) March 26, 2026 19:17
@christineweng christineweng merged commit 6be3876 into elastic:main Mar 26, 2026
18 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #1 / Alert details expandable flyout left panel session view "before each" hook for "should display session view under visualize" "before each" hook for "should display session view under visualize"
  • [job] [logs] x-pack/platform/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts / alerting api integration security and spaces enabled - Group 2 Connectors http action OAuth2 client credentials should refresh the token once the previous one has expired

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 +1.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 208.2KB 208.2KB +8.0B

History

cc @christineweng

mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 26, 2026
…hanges

* commit '22bf09c82658b9511cbb2ad13f6dd29ad3526472': (21 commits)
  [Overlays System Flyout]: Support Child History (elastic#256339)
  KUA-Update event naming format and examples (elastic#259846)
  Fix pagerduty connector codeownership (elastic#259807)
  [Upgrade Assistant] Migrate Kibana deprecations flaky integration tests to unit tests (elastic#258981)
  [Upgrade Assistant] Migrate ES deprecations flaky integration tests to unit tests (elastic#258142)
  [Index Management] Migrate flaky integration tests to unit tests (elastic#258942)
  [Cases] Rename attachment id to saved object id (elastic#259158)
  [Entity Store] Change hash algo to sha256 (elastic#259453)
  [Security Solution] fixed enhanced security profile header showing for non-alert documents (elastic#259801)
  Update LaunchDarkly (main) (elastic#259008)
  [Discover] Add observability default ES|QL query (elastic#257268)
  Update dependency @redocly/cli to v2.21.1 (main) (elastic#259016)
  Gap reason detected (elastic#258231)
  [One Workflow] Historical executionContext and telemetry (elastic#258623)
  coderabbit: drop SigEvents (elastic#259863)
  [ci] Bump cypress disk (elastic#259861)
  Server timings (elastic#258915)
  Replace deprecated EUI icons in files owned by @elastic/kibana-cases (elastic#255633)
  [ci] Bump storybooks disk (elastic#259858)
  [drilldowns] require embeddables to opt into ON_OPEN_PANEL_MENU trigger (elastic#259637)
  ...
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
## Summary

Before cases v2 change, in the cases code base, `attachmentId` is used
to represent saved object id. With introduction to the V2 schema,
`attachmentId` is used to refer to external document ids, like alert id,
event id etc. This PR renamed all the legacy `attachmentId` to
`savedObjectId` so that it's not confusing for future development.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] [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
- [ ] 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)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
## Summary

Before cases v2 change, in the cases code base, `attachmentId` is used
to represent saved object id. With introduction to the V2 schema,
`attachmentId` is used to refer to external document ids, like alert id,
event id etc. This PR renamed all the legacy `attachmentId` to
`savedObjectId` so that it's not confusing for future development.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] [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
- [ ] 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)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
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 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants