From 7261175571b0bcfd68c538067c60eac12dad84e1 Mon Sep 17 00:00:00 2001 From: Khristinin Nikita Date: Mon, 5 Dec 2022 19:01:02 +0100 Subject: [PATCH] Remove id from item list (#146805) ## Remove id from item list when try to close alerts during update exceptions close: https://github.com/elastic/kibana/issues/146661 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../rule_exceptions/utils/helpers.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx index 41d588a23763a..b1ee787ef60cd 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { EuiCommentProps } from '@elastic/eui'; import { EuiText, EuiAvatar } from '@elastic/eui'; -import { capitalize } from 'lodash'; +import { capitalize, omit } from 'lodash'; import moment from 'moment'; import type { @@ -143,11 +143,12 @@ export const prepareExceptionItemsForBulkClose = ( return exceptionItems.map((item: ExceptionListItemSchema) => { if (item.entries !== undefined) { const newEntries = item.entries.map((itemEntry: Entry | EntryNested) => { + const entry = omit(itemEntry, 'id') as Entry | EntryNested; return { - ...itemEntry, - field: itemEntry.field.startsWith('event.') - ? itemEntry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`) - : itemEntry.field, + ...entry, + field: entry.field.startsWith('event.') + ? entry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`) + : entry.field, }; }); return {