diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx index d3875415c49c72..97a6a00c9cf0ae 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx @@ -384,6 +384,16 @@ describe('Exception helpers', () => { const result = prepareExceptionItemsForBulkClose(payload); expect(result).toEqual(expected); }); + + test("should strip out any comments in the exceptions for bulk close'", () => { + const exceptionItemWithComment = { + ...getExceptionListItemSchemaMock(), + comments: getCommentsArrayMock(), + }; + const payload = [exceptionItemWithComment]; + const result = prepareExceptionItemsForBulkClose(payload); + expect(result).toEqual([getExceptionListItemSchemaMock()]); + }); }); describe('#lowercaseHashValues', () => { 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 6a739fd34a05ae..aaaffb0e70d2ca 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 @@ -154,9 +154,10 @@ export const prepareExceptionItemsForBulkClose = ( return { ...item, entries: newEntries, + comments: [], // Strips out unneeded comments attribute for bulk close as they are not needed and are throwing type errors }; } else { - return item; + return { ...item, comments: [] }; } }); };