Repository navigation
fix(jira): extract sprint relations from the Sprint custom field - #9410
Merged
Merged
Conversation
Issues collected through the search API (apache#8931) no longer carry fields.sprint/fields.closedSprints, so no rows were written to _tool_jira_sprint_issues / sprint_issues for newly synced issues. Sprint membership is still present in the Sprint custom field, so resolve its field id from _tool_jira_issue_fields via the stable schema_custom value com.pyxis.greenhopper.jira:gh-sprint and merge the parsed ids into the extracted sprint relations. Jira Cloud returns an array of objects with an "id" property; Jira Server/DC returns legacy strings like "com.atlassian.greenhopper.service.sprint.Sprint@hash[...,id=2424,...]" which are parsed for the id. When the Sprint field is not collected the extractor keeps the previous structured-fields-only behavior.
klesh
approved these changes
Nov 19, 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.
pr-type/bug-fix,pr-type/feature-development, etc.Summary
Since #8931 the Jira issue collector uses the search API (
api/2/search/api/3/search/jql). Responses from that API no longer includefields.sprint/fields.closedSprints— sprint membership only remains in the Sprint custom field (schemacom.pyxis.greenhopper.jira:gh-sprint, e.g.customfield_10004). As a result_tool_jira_sprint_issues/sprint_issuesget no rows for newly synced issues, and stale relations are never refreshed.This PR restores the relations:
ExtractIssues/ExtractEpicsresolve the Sprint custom field id from_tool_jira_issue_fieldsvia its stableschema_customvalue (the field is frequently renamed, e.g. to "Sprint" in any language).Fields.AllFieldsare merged (deduplicated) with the structuredfields.sprint/fields.closedSprintsids:id;com.atlassian.greenhopper.service.sprint.Sprint@hash[...,id=2424,...]→ parseid=(\d+);The denormalized
sprint_id/sprint_namecolumns on_tool_jira_issuesare intentionally left as-is (still sourced fromfields.sprint) to keep this PR focused on the relation tables; that can be a follow-up.Does this close any open issues?
Closes #9405
Screenshots
N/A (backend extraction change)
Other information
Verification (macOS, Go 1.27):
go test ./plugins/jira/tasks/ -run TestExtractIssuesSprintCustomField -v— 4/4 pass, covering: Server legacy strings, Cloud objects, merge+dedupe with structured fields, and the disabled-path fallback (unresolved field id keeps old behavior):go test ./plugins/jira/tasks/... ./plugins/jira/models/...— allokgolangci-lint run plugins/jira/tasks/...(v2.15.0, same as CI) — 0 issuesgo mod tidy— no diffgh-sprintrow in_tool_jira_issue_fields, so the new path stays inactive there and snapshots are unchanged; the legacy-string fixture in the new unit test uses the exact format quoted in the issue from a real Server/DC instance.