fix(jira): include fields=*all in Jira Server issue search query (fixes #9122) - #9149
Open
Thundercloud12 wants to merge 2 commits into
Open
Thundercloud12 wants to merge 2 commits into
Thundercloud12 wants to merge 2 commits into
Conversation
Contributor
Author
|
@klesh please have a look, thank you! |
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
When collecting issues from Jira Server (on-premise) via
/api/2/searchinsetupIssueV2Collector, thefieldsquery parameter was omitted.According to Atlassian's REST API specifications, when
fieldsis omitted,/rest/api/2/searchdefaults to returning only*navigablefields. Sinceworklogis not a navigable field, Jira Server omits the embeddedfields.worklogarray from the search response payload.This resulted in the following downstream collection failure:
extractIssuescould not extract the embedded worklogs, which contain the first page of up to 20 worklogs, leavingissue.worklog_total = 0.collectWorklogsonly queries issues whereworklog_total > 20, assuming issues with 20 or fewer worklogs were already collected during the first step.jira_issue_worklogs.This PR fixes the issue by:
query.Set("fields", "*all")tosetupIssueV2Collectorinissue_collector.go, bringing it in line withsetupIssueV3Collectorfor Jira Cloud.TestExtractIssuesWorkloginissue_extractor_test.goto ensure embedded worklogs are correctly parsed and recorded.Does this close any open issues?
Closes #9122
Screenshots
Unit tests passing:
Other Information
/rest/api/2/searchstates that the search resource returns only*navigablefields by default.commentandworklogcan contain large amounts of data, so they are excluded from the default*navigableset to keep API responses performant.*all.setupIssueV3Collectorfor Jira Cloud already usesquery.Set("fields", "*all"); this change aligns Jira Server with the same behavior.