Preserve verified flag when promoting duplicate to new original#14934
Open
valentijnscholten wants to merge 1 commit into
Open
Preserve verified flag when promoting duplicate to new original#14934valentijnscholten wants to merge 1 commit into
valentijnscholten wants to merge 1 commit into
Conversation
When the original of a duplicate cluster is deleted (e.g. via engagement deletion), reconfigure_duplicate_cluster promotes the first remaining duplicate to the new primary. It already copies active and is_mitigated from the original, but not verified. The promoted finding kept its own verified=False, which blocked Jira's "Push All Issues" (requires active+verified). Add verified to the fields copied to the new original. Fixes DefectDojo#14911
dogboat
approved these changes
Jun 2, 2026
Jino-T
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reconfigure_duplicate_clusterindojo/finding/helper.pypromotes the first remaining duplicate to the new primary. It already copiesactiveandis_mitigatedfrom the original, but notverified.verified=False, which blocks Jira's "Push All Issues" (requires Active and Verified). Vulnerability stayed visible in DefectDojo with no Jira ticket.verifiedfrom the original to the new primary.unittests/test_prepare_duplicates_for_delete.pycover both directions (original verified+active+not-mitigated, and original unverified+inactive+mitigated), with the duplicate starting in the opposite state for each field so every copy is observable.Out of scope for this PR (potential follow-ups):
JIRA_Issuefrom the deleted original to the new primary (instead of creating a new ticket). The currentJIRA_Issue.findingis aOneToOneFieldwithon_delete=CASCADE, so the row is gone before promotion runs — requires intercepting pre-delete.Finding_Group-level Jira relinking.