Repository navigation
[Jira] JiraCloud: enhanced_jql uses the configured api_version - #1724
Merged
gonchik merged 1 commit intoNov 18, 2026
Merged
Conversation
enhanced_jql used to call the v3 endpoint every time. It will now make requests to the v2 endpoint if the JiraCloud client has been instantiated with api_version=2, and those clients will receive v2 responses. For default clients (api_version=3) the request is unchanged. Fixes atlassian-api#1717
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1724 +/- ##
==========================================
+ Coverage 65.52% 65.54% +0.01%
==========================================
Files 107 107
Lines 19462 19462
Branches 2132 2132
==========================================
+ Hits 12753 12756 +3
Misses 6000 6000
+ Partials 709 706 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #1717.
As
JiraCloud.enhanced_jql()was hardcoded withapi_version=3, a client withapi_version=2still got v3 responses from it. According to the Atlassian platform REST API spec,GET/POST/rest/api/2/search/jqlexists (enhanced search is available in v2). However, I checked this against the spec only (not a live site). The method now uses theapi_versionfrom the client. If unspecified, the default is still version 3. If a client specifies version 2, then version 2 payloads are now returned from this method. The documentation now says the same.The updated test fails on master with
Actual: get('rest/api/3/search/jql', ...).pytest tests/test_jira.py tests/test_jira_cloud_clients.py: 67 passed.The legacy
Jiraclient keeps its fixed v3 URL. Its default is"2", so following it would result in different responses for existing users of this client. The comment indicates that this endpoint is version 3 only, but according to the spec this is incorrect. I can change either one here, depending on your preference.