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

Can't add marking definitions using stix_cyber_observable.add_marking_definition() function #140

@daryakoval

Description

@daryakoval

Description

I am trying to add observable marking, using stix_cyber_observable.add_marking_definition() function, with the following arguments:

mark_obj = MarkingDefinition(client)
marking_id = mark_obj.create(definition='TLP:GREEN', definition_type='TLP').get('id')
result = client.stix_cyber_observable.add_marking_definition(id=id, marking_definition_id=marking_id)

add_marking_definition function return an error because its trying to access non-existing key: "markingDefinitionsIds"
at this line: here

Tried to debug this code, and when the code reaches this line:
image
there is no key "markingDefinitionsIds" at stix_cyber_observable object, but there is "objectMarkingIds" key, maybe it is the requested key?

Environment

  1. OS Mac OS 10
  2. OpenCTI version: OpenCTI 4.0.7
  3. Other environment details: python 3.8

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Try to use client.stix_cyber_observable.add_marking_definition function.

Expected Output

Adding new marking definition successfully.

Actual Output

Error, because code is trying to access non-existing key: "markingDefinitionsIds".

Metadata

Metadata

Assignees

No one assigned

    Labels

    buguse for describing something not working as expectedsolveduse to identify issue that has been solved (must be linked to the solving PR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions