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

Commit 0225053

Browse files
committed
[client] Be able to pass workflow ID to case creation
1 parent bcdfed0 commit 0225053

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pycti/entities/opencti_case_incident.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ def create(self, **kwargs):
471471
granted_refs = kwargs.get("objectOrganization", None)
472472
update = kwargs.get("update", False)
473473
response_types = kwargs.get("response_types", None)
474+
x_opencti_workflow_id = kwargs.get("x_opencti_workflow_id", None)
474475

475476
if name is not None:
476477
self.opencti.log("info", "Creating Case Incident {" + name + "}.")
@@ -507,6 +508,7 @@ def create(self, **kwargs):
507508
"x_opencti_stix_ids": x_opencti_stix_ids,
508509
"update": update,
509510
"response_types": response_types,
511+
"x_opencti_workflow_id": x_opencti_workflow_id,
510512
}
511513
},
512514
)
@@ -636,6 +638,12 @@ def import_from_stix2(self, **kwargs):
636638
stix_object["granted_refs"] = self.opencti.get_attribute_in_extension(
637639
"granted_refs", stix_object
638640
)
641+
if "x_opencti_workflow_id" not in stix_object:
642+
stix_object[
643+
"x_opencti_workflow_id"
644+
] = self.opencti.get_attribute_in_extension(
645+
"x_opencti_workflow_id", stix_object
646+
)
639647

640648
return self.create(
641649
stix_id=stix_object["id"],
@@ -676,6 +684,9 @@ def import_from_stix2(self, **kwargs):
676684
objectOrganization=stix_object["granted_refs"]
677685
if "granted_refs" in stix_object
678686
else None,
687+
x_opencti_workflow_id=stix_object["x_opencti_workflow_id"]
688+
if "x_opencti_workflow_id" in stix_object
689+
else None,
679690
update=update,
680691
)
681692
else:

0 commit comments

Comments
 (0)