Add finding group support to jira_status_reconciliation command #14267
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
jira_status_reconciliationmanagement command, fixing Finding groups are not processed by jira_status_reconciliation synchronization command option. #14031 where grouped findings pushed to JIRA as groups were completely skipped during reconciliation--include-findings/--no-include-findingsand--include-finding-groups/--no-include-finding-groupsCLI flags so users can control which types to reconcilepush_status_to_jiradirectly on the group object (notpush_finding_group_to_jirawhich would also push individual finding JIRA issues already handled by the existing loop)How It Works
The JIRA_Issue model has separate OneToOneField relationships to Finding and Finding_Group. A JIRA issue is linked to either a Finding or a Finding_Group, never both. The existing findings loop and the new finding groups loop operate on mutually exclusive sets of JIRA issues.
For finding groups, the reconciliation:
last_status_updateandlast_reviewedfrom the max values across all findings in the groupany(f.active for f in group.findings.all())push_status_to_jira(),process_resolution_from_jira(),_safely_get_obj_status_for_jira()all already support Finding_Group objects