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

Commit 3a019e9

Browse files
SarahBocognanoSouadHadjiat
authored andcommitted
[backend][POC] Remove labels from playbooks (#6669)
1 parent 727a64e commit 3a019e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,7 +2763,7 @@ def apply_opencti_operation(self, item, operation):
27632763
if source_ids is None:
27642764
source_ids = item["merge_source_ids"]
27652765
self.opencti.stix.merge(id=target_id, object_ids=source_ids)
2766-
elif operation == "patch":
2766+
elif operation == "patch" or operation == "upsert_patch":
27672767
self.apply_patch(item=item)
27682768
elif operation == "pir_flag_element":
27692769
id = item["id"]
@@ -2840,10 +2840,12 @@ def import_item(
28402840
opencti_operation = self.opencti.get_attribute_in_extension(
28412841
"opencti_operation", item
28422842
)
2843-
if opencti_operation is not None:
2843+
if opencti_operation is None and "opencti_operation" in item:
2844+
opencti_operation=item["opencti_operation"]
2845+
if opencti_operation is not None and opencti_operation == "upsert_patch":
2846+
self.apply_opencti_operation(item, opencti_operation)
2847+
if opencti_operation is not None and opencti_operation != "upsert_patch":
28442848
self.apply_opencti_operation(item, opencti_operation)
2845-
elif "opencti_operation" in item:
2846-
self.apply_opencti_operation(item, item["opencti_operation"])
28472849
elif item["type"] == "relationship":
28482850
# Import relationship
28492851
self.import_relationship(item, update, types)

0 commit comments

Comments
 (0)