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

Commit 5d87dfb

Browse files
author
Samuel Hassine
committed
[client] Fix filter by external reference
1 parent 189fe11 commit 5d87dfb

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

pycti/entities/opencti_note.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,17 @@ def create(self, **kwargs):
402402
id
403403
}
404404
}
405+
externalReferences {
406+
edges {
407+
node {
408+
id
409+
stix_id_key
410+
source_name
411+
description
412+
url
413+
}
414+
}
415+
}
405416
"""
406417
object_result = None
407418
if external_reference_id is not None:

pycti/entities/opencti_opinion.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,17 @@ def create(self, **kwargs):
410410
id
411411
}
412412
}
413+
externalReferences {
414+
edges {
415+
node {
416+
id
417+
stix_id_key
418+
source_name
419+
description
420+
url
421+
}
422+
}
423+
}
413424
"""
414425
object_result = None
415426
if external_reference_id is not None:

pycti/entities/opencti_report.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,23 @@ def create(self, **kwargs):
420420
id
421421
entity_type
422422
name
423-
description
423+
description
424424
createdByRef {
425425
node {
426426
id
427427
}
428428
}
429+
externalReferences {
430+
edges {
431+
node {
432+
id
433+
stix_id_key
434+
source_name
435+
description
436+
url
437+
}
438+
}
439+
}
429440
"""
430441
object_result = None
431442
if external_reference_id is not None:

pycti/utils/opencti_stix2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ def extract_embedded_relationships(self, stix_object, types=None) -> dict:
391391
for match in matches:
392392
if match < today:
393393
published = match.strftime("%Y-%m-%dT%H:%M:%SZ")
394+
break
394395
except:
395396
published = None
396397
if published is None:
@@ -740,6 +741,7 @@ def import_relationship(self, stix_relation, update=False, types=None):
740741
for match in matches:
741742
if match < today:
742743
date = match.strftime("%Y-%m-%dT%H:%M:%SZ")
744+
break
743745
except:
744746
date = None
745747
if date is None:

0 commit comments

Comments
 (0)