diff --git a/opencti-platform/opencti-graphql/src/database/redis.ts b/opencti-platform/opencti-graphql/src/database/redis.ts index fde851cb9b9b..fa93e8b089e7 100644 --- a/opencti-platform/opencti-graphql/src/database/redis.ts +++ b/opencti-platform/opencti-graphql/src/database/redis.ts @@ -526,7 +526,7 @@ export const buildStixUpdateEvent = (user: AuthUser, previousStix: StixCoreObjec context: { patch, reverse_patch: previousPatch, - relatedRestrictions: opts.relatedRestrictions, + related_restrictions: opts.related_restrictions, } }; }; diff --git a/opencti-platform/opencti-graphql/src/manager/historyManager.ts b/opencti-platform/opencti-graphql/src/manager/historyManager.ts index 5c1107daf328..84603d383bca 100644 --- a/opencti-platform/opencti-graphql/src/manager/historyManager.ts +++ b/opencti-platform/opencti-graphql/src/manager/historyManager.ts @@ -123,8 +123,8 @@ export const buildHistoryElementsFromEvents = async (context:AuthContext, events .filter((o) => isNotEmptyField(o)) as string[]; eventMarkingRefs.push(...previousMarkingRefs); // Get related restrictions (e.g. markings of added objects in a container) - if (updateEvent.context.relatedRestrictions) { - const relatedMarkings = updateEvent.context.relatedRestrictions.markings ?? []; + if (updateEvent.context.related_restrictions) { + const relatedMarkings = updateEvent.context.related_restrictions.markings ?? []; eventMarkingRefs.push(...relatedMarkings); } } diff --git a/opencti-platform/opencti-graphql/src/types/event.d.ts b/opencti-platform/opencti-graphql/src/types/event.d.ts index 19d1a5f82827..5448345c2385 100644 --- a/opencti-platform/opencti-graphql/src/types/event.d.ts +++ b/opencti-platform/opencti-graphql/src/types/event.d.ts @@ -19,7 +19,7 @@ interface CreateEventOpts extends EventOpts { interface UpdateEventOpts extends EventOpts { commit?: CommitContext | undefined; - relatedRestrictions?: { markings: string[] }; + related_restrictions?: { markings: string[] }; } interface RelationCreation { @@ -53,7 +53,7 @@ interface UpdateEvent extends StreamDataEvent { context: { patch: Array; reverse_patch: Array; - relatedRestrictions?: { markings: string[] }; + related_restrictions?: { markings: string[] }; }; } diff --git a/opencti-platform/opencti-graphql/tests/02-integration/04-manager/historyManager-test.js b/opencti-platform/opencti-graphql/tests/02-integration/04-manager/historyManager-test.js index 7cbfa4157b0b..588257126d5b 100644 --- a/opencti-platform/opencti-graphql/tests/02-integration/04-manager/historyManager-test.js +++ b/opencti-platform/opencti-graphql/tests/02-integration/04-manager/historyManager-test.js @@ -195,7 +195,7 @@ const eventWithRelatedRestriction = { path: '/object_refs/7' } ], - relatedRestrictions: { + related_restrictions: { markings: [ '4584aeee-10b6-47a7-808e-603440642285' ]