Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 5bd47f1

Browse files
[client-python] Get all report's properties when using csv mapper (#711)
Co-authored-by: Samuel Hassine <[email protected]>
1 parent eea09fc commit 5bd47f1

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

pycti/entities/opencti_report.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ def create(self, **kwargs):
694694
created_by = kwargs.get("createdBy", None)
695695
objects = kwargs.get("objects", None)
696696
object_marking = kwargs.get("objectMarking", None)
697+
object_assignee = kwargs.get("objectAssignee", None)
698+
object_participant = kwargs.get("objectParticipant", None)
697699
object_label = kwargs.get("objectLabel", None)
698700
external_references = kwargs.get("externalReferences", None)
699701
revoked = kwargs.get("revoked", None)
@@ -733,6 +735,8 @@ def create(self, **kwargs):
733735
"objectMarking": object_marking,
734736
"objectLabel": object_label,
735737
"objectOrganization": granted_refs,
738+
"objectAssignee": object_assignee,
739+
"objectParticipant": object_participant,
736740
"objects": objects,
737741
"externalReferences": external_references,
738742
"revoked": revoked,
@@ -886,7 +890,16 @@ def import_from_stix2(self, **kwargs):
886890
)
887891
if "x_opencti_content" in stix_object:
888892
stix_object["content"] = stix_object["x_opencti_content"]
889-
893+
if "x_opencti_assignee_ids" not in stix_object:
894+
stix_object["x_opencti_assignee_ids"] = (
895+
self.opencti.get_attribute_in_extension("assignee_ids", stix_object)
896+
)
897+
if "x_opencti_participant_ids" not in stix_object:
898+
stix_object["x_opencti_participant_ids"] = (
899+
self.opencti.get_attribute_in_extension(
900+
"participant_ids", stix_object
901+
)
902+
)
890903
return self.create(
891904
stix_id=stix_object["id"],
892905
createdBy=(
@@ -897,6 +910,16 @@ def import_from_stix2(self, **kwargs):
897910
if "object_marking_ids" in extras
898911
else None
899912
),
913+
objectAssignee=(
914+
stix_object["x_opencti_assignee_ids"]
915+
if "x_opencti_assignee_ids" in stix_object
916+
else None
917+
),
918+
objectParticipant=(
919+
stix_object["x_opencti_participant_ids"]
920+
if "x_opencti_participant_ids" in stix_object
921+
else None
922+
),
900923
objectLabel=(
901924
extras["object_label_ids"] if "object_label_ids" in extras else None
902925
),

0 commit comments

Comments
 (0)