diff --git a/pycti/utils/opencti_stix2.py b/pycti/utils/opencti_stix2.py index dc0c2cdc..95f166ae 100644 --- a/pycti/utils/opencti_stix2.py +++ b/pycti/utils/opencti_stix2.py @@ -1314,38 +1314,6 @@ def import_sighting( } # Create the sighting - - ### Get the FROM - if from_id in self.mapping_cache: - final_from_id = self.mapping_cache[from_id]["id"] - else: - stix_object_result = ( - self.opencti.opencti_stix_object_or_stix_relationship.read(id=from_id) - ) - if stix_object_result is not None: - final_from_id = stix_object_result["id"] - else: - self.opencti.app_logger.error( - "From ref of the sighting not found, doing nothing..." - ) - return None - - ### Get the TO - final_to_id = None - if to_id: - if to_id in self.mapping_cache: - final_to_id = self.mapping_cache[to_id]["id"] - else: - stix_object_result = ( - self.opencti.opencti_stix_object_or_stix_relationship.read(id=to_id) - ) - if stix_object_result is not None: - final_to_id = stix_object_result["id"] - else: - self.opencti.app_logger.error( - "To ref of the sighting not found, doing nothing..." - ) - return None if ( "x_opencti_negative" not in stix_sighting and self.opencti.get_attribute_in_extension("negative", stix_sighting) @@ -1359,8 +1327,8 @@ def import_sighting( self.opencti.get_attribute_in_extension("workflow_id", stix_sighting) ) stix_sighting_result = self.opencti.stix_sighting_relationship.create( - fromId=final_from_id, - toId=final_to_id, + fromId=from_id, + toId=to_id, stix_id=stix_sighting["id"] if "id" in stix_sighting else None, description=( self.convert_markdown(stix_sighting["description"])