Jira: support fields on close/reopen transitions#15213
Open
devGregA wants to merge 2 commits into
Open
Conversation
Some Jira workflows reject a transition unless specific fields (e.g. a Resolution and a justification custom field) are provided on the transition screen. DefectDojo previously fired close/reopen transitions with only a transition ID, making such workflows impossible to satisfy. Adds JIRA_Project.close_transition_fields / reopen_transition_fields (JSON, same pattern as custom_fields) which are sent as the `fields` payload of jira.transition_issue() at every transition call site: status pushes (close/reopen), deleted-finding close, and epic close. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
paulOsinski
approved these changes
Jul 10, 2026
Contributor
|
Tested this one:
Local testing
Note that modern Jira auto-fills resolution on close, so you need custom fields if you actually want to "block" issue closure. If your workflow just "requires a resolution" without a custom field, Jira will simply pick a default resolution and close the issue anyway. |
paulOsinski
approved these changes
Jul 10, 2026
Jino-T
approved these changes
Jul 10, 2026
blakeaowens
approved these changes
Jul 10, 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.
Description
Some Jira workflows require specific fields to be present on a transition screen — e.g. a workflow that refuses to close an Issue unless a Resolution and a justification custom field are provided. DefectDojo currently fires close/reopen transitions with only a transition ID (
jira_transitionpasses nothing else tojira.transition_issue), making such workflows impossible to satisfy: the transition is rejected and findings/issues drift out of sync.This adds two JSON settings on
JIRA_Project, mirroring the existingcustom_fieldspattern:close_transition_fields— sent as thefieldspayload of every close transitionreopen_transition_fields— same for reopenExample:
{ "resolution": {"name": "Won't Fix"}, "customfield_10200": "Risk accepted by security team" }The payload is applied at every transition call site: status pushes (close + reopen in
push_status_to_jira), the deleted-finding close task (fields are captured at dispatch time since the finding/JIRA_Issue rows are gone when the task runs), and the raw-REST epic close. Form and API serializer expose the new settings with the same inheritance and JSON-coercion behavior ascustom_fields.Documented limitation: one static blob per close/reopen — the values cannot vary per finding disposition (a fixed-close and a false-positive-close send the same fields). The docs section added here calls that out.
Test results
unittests.test_jira_helper: 33/33 pass — newJIRATransitionFieldsTestcoversjira_transitionwith/without/empty fields (legacy call preserved byte-for-byte when unset), close/reopen payload selection inpush_status_to_jira(including project resolution when no project is passed), the deleted-finding task passing dispatched fields, and the epic-close REST payload with and without configuration. Existing dispatch/transition assertions updated for the new keyword.Documentation
docs/content/issue_tracking/jira/PRO__jira_guide.mdgains a "Close / Reopen Transition fields" section with the example above, the transition-screen requirement, and the static-blob limitation.🤖 Generated with Claude Code