Skip to content

Commit

Permalink
[8.8] [Security Solution] {{state.signals_count}} Object not working (#…
Browse files Browse the repository at this point in the history
…156472) (#156707) (#156800)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Security Solution] {{state.signals_count}} Object not working
(#156472) (#156707)](#156707)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2023-05-05T08:23:37Z","message":"[Security
Solution] {{state.signals_count}} Object not working (#156472)
(#156707)\n\n## Summary\r\n\r\nOriginal ticket:
https://github.com/elastic/kibana/issues/156472\r\n\r\nThese changes
adds `{{state.signals_count}}` object to be available in\r\nmessage body
for the `\"For each alert\"`
option.","sha":"99e5e38111b9c82fca16645f939628aa72bfef73","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Team:Detection
Alerts","backport:prev-minor","ci:cloud-deploy","v8.9.0"],"number":156707,"url":"https://github.com/elastic/kibana/pull/156707","mergeCommit":{"message":"[Security
Solution] {{state.signals_count}} Object not working (#156472)
(#156707)\n\n## Summary\r\n\r\nOriginal ticket:
https://github.com/elastic/kibana/issues/156472\r\n\r\nThese changes
adds `{{state.signals_count}}` object to be available in\r\nmessage body
for the `\"For each alert\"`
option.","sha":"99e5e38111b9c82fca16645f939628aa72bfef73"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156707","number":156707,"mergeCommit":{"message":"[Security
Solution] {{state.signals_count}} Object not working (#156472)
(#156707)\n\n## Summary\r\n\r\nOriginal ticket:
https://github.com/elastic/kibana/issues/156472\r\n\r\nThese changes
adds `{{state.signals_count}}` object to be available in\r\nmessage body
for the `\"For each alert\"`
option.","sha":"99e5e38111b9c82fca16645f939628aa72bfef73"}}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
  • Loading branch information
kibanamachine and e40pud authored May 5, 2023
1 parent 592fc0d commit 3546b82
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export const createPersistenceRuleTypeWrapper: CreatePersistenceRuleTypeWrapper
createdAlerts.forEach((alert) =>
options.services.alertFactory
.create(alert._id)
.replaceState({
signals_count: 1,
})
.scheduleActions(type.defaultActionGroupId, {
rule: mapKeys(snakeCase, {
...options.params,
Expand Down Expand Up @@ -380,6 +383,9 @@ export const createPersistenceRuleTypeWrapper: CreatePersistenceRuleTypeWrapper
createdAlerts.forEach((alert) =>
options.services.alertFactory
.create(alert._id)
.replaceState({
signals_count: 1,
})
.scheduleActions(type.defaultActionGroupId, {
rule: mapKeys(snakeCase, {
...options.params,
Expand Down

0 comments on commit 3546b82

Please sign in to comment.