Skip to content

[ResponseOps][Rules] Cases action title length too long#219226

Merged
georgianaonoleata1904 merged 6 commits intoelastic:mainfrom
georgianaonoleata1904:cases-action-title-too-long
May 2, 2025
Merged

[ResponseOps][Rules] Cases action title length too long#219226
georgianaonoleata1904 merged 6 commits intoelastic:mainfrom
georgianaonoleata1904:cases-action-title-too-long

Conversation

@georgianaonoleata1904
Copy link
Contributor

@georgianaonoleata1904 georgianaonoleata1904 commented Apr 25, 2025

Closes #217007

Summary

This PR updates the logic in the getCasesTitle function to better control and format the generated case title, ensuring it compiles with the length limits.

The case title is formed by concatenating: Rule name + suffix
The suffix is structured as: - Grouping by + grouping description + (counter) + (Auto-created)
The problem occurs when a rule with a very long name is created, a cases action is added to that rule and the group by alert field is rule.name. In this scenario, the rule name and the grouping description become very long and if the case title exceeds the 160-character limit, the case won't be created.

What changed:

  • Rule name truncation:
    • the rule name is now trimmed to a maximum of 100 characters (including ... if needed)
  • Suffix restructuring:
    • the total suffix length is limited to 60 characters
    • the grouping description is dynamically trimmed (with ...) to ensure the suffix doesn't exceed the limit

@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review April 28, 2025 09:08
@georgianaonoleata1904 georgianaonoleata1904 requested a review from a team as a code owner April 28, 2025 09:08
@georgianaonoleata1904 georgianaonoleata1904 self-assigned this Apr 28, 2025
@georgianaonoleata1904 georgianaonoleata1904 added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.0.0 backport:version Backport to applied version labels v8.18.0 v9.1.0 v8.19.0 labels Apr 28, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

const maxGroupingDescriptionLength =
maxSuffixLength - (staticSuffixStart.length + staticSuffixEnd.length);

const groupingDescriptionTrimmed =
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a test for the trimmed grouping description in x-pack/platform/plugins/shared/cases/server/connectors/cases/cases_connector_executor.test.ts

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @georgianaonoleata1904

: ruleNameTrimmed;

const maxSuffixLength =
ruleNameTrimmedWithDots.length < MAX_RULE_NAME_LENGTH
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we could call it ellipsis instead of dots with totalDots = 3

const staticSuffixEnd = `${oracleCounterString} (${AUTO_CREATED_TITLE})`;

const ruleName = params.rule.name;
const ruleNameTrimmed = ruleName.slice(0, MAX_RULE_NAME_LENGTH - totalDots);
Copy link
Contributor

@jcger jcger Apr 30, 2025

Choose a reason for hiding this comment

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

Given MAX_RULE_NAME_LENGTH = 15 and totalDots = 3, if the rule name is something like "MY_RULE_TITLE" (length 13), it would end up using "MY_RULE_TITL..." even though the original rule name is valid. Is this expected?

);
});

it(`trims the grouping description correctly if the cases title is bigger than ${MAX_TITLE_LENGTH}`, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have/need a test to check that if the title length is shorter than MAX_TITLE_LENGTH it doesn't get trimmed?

@georgianaonoleata1904 georgianaonoleata1904 merged commit 6d95b2a into elastic:main May 2, 2025
15 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/14792857189

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 2, 2025
Closes elastic#217007

## Summary

This PR updates the logic in the getCasesTitle function to better
control and format the generated case title, ensuring it compiles with
the length limits.

The case title is formed by concatenating:  `Rule name` + `suffix`
The `suffix` is structured as: ` - Grouping by` + `grouping description`
+ `(counter)` + `(Auto-created)`
The problem occurs when a rule with a very long name is created, a cases
action is added to that rule and the group by alert field is
**rule.name**. In this scenario, the rule name and the grouping
description become very long and if the case title exceeds the
160-character limit, the case won't be created.

What changed:
- `Rule name truncation`:
- the **rule name** is now trimmed to a maximum of **100**
**characters** (including `...` if needed)
- `Suffix restructuring`:
    - the total **suffix** length is limited to **60 characters**
- the **grouping description** is dynamically trimmed (with `...`) to
ensure the suffix doesn't exceed the limit

(cherry picked from commit 6d95b2a)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 2, 2025
Closes elastic#217007

## Summary

This PR updates the logic in the getCasesTitle function to better
control and format the generated case title, ensuring it compiles with
the length limits.

The case title is formed by concatenating:  `Rule name` + `suffix`
The `suffix` is structured as: ` - Grouping by` + `grouping description`
+ `(counter)` + `(Auto-created)`
The problem occurs when a rule with a very long name is created, a cases
action is added to that rule and the group by alert field is
**rule.name**. In this scenario, the rule name and the grouping
description become very long and if the case title exceeds the
160-character limit, the case won't be created.

What changed:
- `Rule name truncation`:
- the **rule name** is now trimmed to a maximum of **100**
**characters** (including `...` if needed)
- `Suffix restructuring`:
    - the total **suffix** length is limited to **60 characters**
- the **grouping description** is dynamically trimmed (with `...`) to
ensure the suffix doesn't exceed the limit

(cherry picked from commit 6d95b2a)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 2, 2025
Closes elastic#217007

## Summary

This PR updates the logic in the getCasesTitle function to better
control and format the generated case title, ensuring it compiles with
the length limits.

The case title is formed by concatenating:  `Rule name` + `suffix`
The `suffix` is structured as: ` - Grouping by` + `grouping description`
+ `(counter)` + `(Auto-created)`
The problem occurs when a rule with a very long name is created, a cases
action is added to that rule and the group by alert field is
**rule.name**. In this scenario, the rule name and the grouping
description become very long and if the case title exceeds the
160-character limit, the case won't be created.

What changed:
- `Rule name truncation`:
- the **rule name** is now trimmed to a maximum of **100**
**characters** (including `...` if needed)
- `Suffix restructuring`:
    - the total **suffix** length is limited to **60 characters**
- the **grouping description** is dynamically trimmed (with `...`) to
ensure the suffix doesn't exceed the limit

(cherry picked from commit 6d95b2a)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.19
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 2, 2025
…) (#219909)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ResponseOps][Rules] Cases action title length too long
(#219226)](#219226)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2025-05-02T09:45:06Z","message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[ResponseOps][Rules]
Cases action title length too
long","number":219226,"url":"https://github.com/elastic/kibana/pull/219226","mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219226","number":219226,"mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
kibanamachine added a commit that referenced this pull request May 2, 2025
… (#219910)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[ResponseOps][Rules] Cases action title length too long
(#219226)](#219226)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2025-05-02T09:45:06Z","message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[ResponseOps][Rules]
Cases action title length too
long","number":219226,"url":"https://github.com/elastic/kibana/pull/219226","mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219226","number":219226,"mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
kibanamachine added a commit that referenced this pull request May 2, 2025
…) (#219908)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[ResponseOps][Rules] Cases action title length too long
(#219226)](#219226)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2025-05-02T09:45:06Z","message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[ResponseOps][Rules]
Cases action title length too
long","number":219226,"url":"https://github.com/elastic/kibana/pull/219226","mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219226","number":219226,"mergeCommit":{"message":"[ResponseOps][Rules]
Cases action title length too long (#219226)\n\nCloses
https://github.com/elastic/kibana/issues/217007\n\n## Summary\n\nThis PR
updates the logic in the getCasesTitle function to better\ncontrol and
format the generated case title, ensuring it compiles with\nthe length
limits.\n\nThe case title is formed by concatenating: `Rule name` +
`suffix`\nThe `suffix` is structured as: ` - Grouping by` + `grouping
description`\n+ `(counter)` + `(Auto-created)`\nThe problem occurs when
a rule with a very long name is created, a cases\naction is added to
that rule and the group by alert field is\n**rule.name**. In this
scenario, the rule name and the grouping\ndescription become very long
and if the case title exceeds the\n160-character limit, the case won't
be created.\n\nWhat changed: \n- `Rule name truncation`:\n- the **rule
name** is now trimmed to a maximum of **100**\n**characters** (including
`...` if needed)\n- `Suffix restructuring`: \n - the total **suffix**
length is limited to **60 characters**\n- the **grouping description**
is dynamically trimmed (with `...`) to\nensure the suffix doesn't exceed
the
limit","sha":"6d95b2aa2e2794e9ae0729ab7917f5d1cd7d9497"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
kapral18 added a commit to kapral18/kibana that referenced this pull request May 4, 2025
…ends-crash

* main: (111 commits)
  [ResponseOps][Rules] Cases action title length too long (elastic#219226)
  [main] Sync bundled packages with Package Storage (elastic#219839)
  Fix ignored dynamic templates (elastic#219875)
  Enforce dependency review by kibana-security workflow (elastic#219262)
  [Security Solution] [Detections] Removes tech preview text from eql seq suppression ui (elastic#219870)
  [Security Solution] Fix alerts table potentially not applying alert assignees (elastic#219460)
  fix(slo): alert deletion (elastic#219876)
  [AI4DSOC] fix styling to address cutoff when screen is narrow (elastic#219306)
  [Security Solution][Endpoint] Response action create and history log API updates in of space awareness (elastic#218674)
  Update publish_oas_docs.sh to deploy Kibana Serverless API docs (elastic#219867)
  feat(slo): lock resource installation (elastic#219747)
  [AI4DSOC] Alert flyout code cleanup (elastic#219810)
  [fleet] fixing `isAgentlessDefault` config usage and readability improvements to `isAgentlessSetupDefault` (elastic#219423)
  feat(slo): Bulk delete UI (elastic#219634)
  m1 demo prep (elastic#219588)
  [Security Solution] Replace sourcerer in EQL tab with dataview picker (elastic#218897)
  [AI4DSOC] Attack discovery widget follow up follow up (elastic#219849)
  [AI Assistant] Fix some OpenAI models not accepting temperature for Inference service (elastic#218887)
  Update dependency msw to ~2.7.5 (main) (elastic#219289)
  Use new client URLs in doc link service (elastic#219600)
  ...
@mistic mistic added v8.18.2 and removed v8.18.1 labels May 6, 2025
@mistic
Copy link
Contributor

mistic commented May 6, 2025

This PR didn't make it into the latest 8.18.1 and 9.0.1 BC. Updating the labels.

@mistic mistic added v9.0.2 and removed v9.0.1 labels May 6, 2025
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
Closes elastic#217007

## Summary

This PR updates the logic in the getCasesTitle function to better
control and format the generated case title, ensuring it compiles with
the length limits.

The case title is formed by concatenating:  `Rule name` + `suffix`
The `suffix` is structured as: ` - Grouping by` + `grouping description`
+ `(counter)` + `(Auto-created)`
The problem occurs when a rule with a very long name is created, a cases
action is added to that rule and the group by alert field is
**rule.name**. In this scenario, the rule name and the grouping
description become very long and if the case title exceeds the
160-character limit, the case won't be created.

What changed: 
- `Rule name truncation`:
- the **rule name** is now trimmed to a maximum of **100**
**characters** (including `...` if needed)
- `Suffix restructuring`: 
    - the total **suffix** length is limited to **60 characters**
- the **grouping description** is dynamically trimmed (with `...`) to
ensure the suffix doesn't exceed the limit
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
Closes elastic#217007

## Summary

This PR updates the logic in the getCasesTitle function to better
control and format the generated case title, ensuring it compiles with
the length limits.

The case title is formed by concatenating:  `Rule name` + `suffix`
The `suffix` is structured as: ` - Grouping by` + `grouping description`
+ `(counter)` + `(Auto-created)`
The problem occurs when a rule with a very long name is created, a cases
action is added to that rule and the group by alert field is
**rule.name**. In this scenario, the rule name and the grouping
description become very long and if the case title exceeds the
160-character limit, the case won't be created.

What changed: 
- `Rule name truncation`:
- the **rule name** is now trimmed to a maximum of **100**
**characters** (including `...` if needed)
- `Suffix restructuring`: 
    - the total **suffix** length is limited to **60 characters**
- the **grouping description** is dynamically trimmed (with `...`) to
ensure the suffix doesn't exceed the limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.18.2 v8.19.0 v9.0.2 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Response Ops][Rules] Cases action title length too long

6 participants