Skip to content

fix: check if product_type exist, than dont try to create the product…#149

Open
hektor1966 wants to merge 1 commit intotelekom-mms:mainfrom
hektor1966:dont_create_product_type_on_reimport
Open

fix: check if product_type exist, than dont try to create the product…#149
hektor1966 wants to merge 1 commit intotelekom-mms:mainfrom
hektor1966:dont_create_product_type_on_reimport

Conversation

@hektor1966
Copy link

@hektor1966 hektor1966 commented Dec 30, 2025

We are organizing our findings with product_type's.
On reimports, the operator try to set the product_type_name. When the product_type in DD is other than as in the operator defined, you will get the following error.

Handler 'send_to_dojo' failed temporarily:
HTTP error occurred: 400
Client Error: Bad Request for url: https://defectdojo.example.com/api/v2/reimport-scan/
["The fetched product has a conflict with the supplied product type name:
existing product type name - Research and Development vs supplied product type name - Ops"]'.
Retrying in 60 seconds

With the fix, the operator looks when a product exists. When it exists, the operator will not try to set the product_type.
So we can use different product_types.

I tested the change in our development environment, and it works as expected. Product_type will not try to create, new product will create with the default product_type.

Product 'foo' already exists in DefectDojo
Handler 'send_to_dojo' succeeded.

@hektor1966
Copy link
Author

@szEvEz @rndmh3ro
Hello, are there any uncertainties regarding the MR? Do you require additional information or tests?

"scan_type": "Trivy Operator Scan",
"engagement_name": _DEFECT_DOJO_ENGAGEMENT_NAME,
"product_name": _DEFECT_DOJO_PRODUCT_NAME,
"product_type_name": _DEFECT_DOJO_PRODUCT_TYPE_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here is a confusion of product_name and product_type_name. Can you clarify which is relevant here? Either the API call is on the wrong endpoint or this variable is mixed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants