[SIEM][Detection Engine] Tags being turned into null (#55516)
## Summary Test: 1.) Add a tag to a new rule 2.) Activate the rule 3.) Ensure the tag does not go away ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] 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/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ ~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~ ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ - [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
This commit is contained in:
parent
81177fbb37
commit
97e6ae502b
|
@ -173,12 +173,11 @@ export const updateRules = async ({
|
||||||
} else {
|
} else {
|
||||||
// enabled is null or undefined and we do not touch the rule
|
// enabled is null or undefined and we do not touch the rule
|
||||||
}
|
}
|
||||||
|
|
||||||
return alertsClient.update({
|
return alertsClient.update({
|
||||||
id: rule.id,
|
id: rule.id,
|
||||||
data: {
|
data: {
|
||||||
tags: addTags(
|
tags: addTags(
|
||||||
tags,
|
tags != null ? tags : rule.tags, // Add tags as an update if it exists, otherwise re-use the older tags
|
||||||
rule.params.ruleId,
|
rule.params.ruleId,
|
||||||
immutable != null ? immutable : rule.params.immutable // Add new one if it exists, otherwise re-use old one
|
immutable != null ? immutable : rule.params.immutable // Add new one if it exists, otherwise re-use old one
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue