Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint #2326

Merged

Conversation

skumar36-atlassian
Copy link
Contributor

@skumar36-atlassian skumar36-atlassian commented Mar 18, 2025

Overview

This PR introduces two new functions for Jira Cloud:

enhanced_search_issues

  • Leverages the new search/jql REST endpoint with nextPageToken-based pagination.
  • Replaces the deprecated search API endpoints (GET/POST /rest/api/3/search).
  • Allows for either limited or complete fetching of results (when maxResults is set to False).
  • Atlassian will remove support for the old search API on May 1, 2025.

approximate_issue_count

  • Calls the search/approximate-count API to retrieve an approximate count of issues matching a given JQL query.
  • Returns either an integer count or the full JSON response based on the json_result flag.
  • Available only for Jira Cloud.

Changes

enhanced_search_issues

✅ Implements nextPageToken-based pagination.
✅ Fetches all results if maxResults evaluates to False; otherwise, it fetches up to the specified limit.

approximate_issue_count

✅ Retrieves an approximate count of issues for a given JQL query.
✅ Returns either an integer count or the full JSON response.

💡 Both functions are decorated with @cloud_api to ensure they are only used on Jira Cloud.
🔹 Jira Cloud users will use these new APIs.
🔹 Jira Server/Data Center users remain unaffected and will continue using the existing APIs.

Deprecation Fix: Explicit Sphinx Configuration

  • Read the Docs has deprecated automatic detection of Sphinx/MkDocs configuration files, leading to potential build failures. To ensure stable and predictable documentation builds, we have explicitly defined the sphinx.configuration key in .readthedocs.yaml.
  • For more details, refer to the official announcement: Read the Docs Deprecation Notice

Testing & Limitations

Manual Testing

✔️ Validated against a Jira Cloud instance.

Unit Tests

⚠️ Unit tests for these cloud-specific endpoints could not be fully implemented due to challenges in configuring the test environment for Jira Cloud.
🔹 Further work is needed to establish a dedicated Jira Cloud test setup.

Migration & Impact

🚨 Breaking Change

  • Atlassian has already deprecated the old search API endpoints, with support ending on May 1, 2025.
  • Jira Cloud users must migrate to using enhanced_search_issues and approximate_issue_count to ensure continued compatibility.
  • Jira Server/Data Center users are not affected and can continue using the existing APIs.

Additional Context

  • This update aligns with Atlassian's deprecation roadmap, improving performance and reliability for Jira Cloud users.
  • For any questions or further clarification, please refer to the discussion thread on this PR or reach out via our developer community forum.

Please review the changes and let me know if any further modifications are required. 🚀

skumar36-atlassian and others added 5 commits March 17, 2025 13:32
Introduce a new function enhanced_search_issues that calls the new search/jql REST endpoint,
replacing the deprecated search API for Jira Cloud. This update leverages nextPageToken-based
pagination for improved performance and prepares the library for the removal of the old endpoints
(GET/POST /rest/api/3/search) effective May 1, 2025.

BREAKING CHANGE: Jira Cloud users should migrate to enhanced_search_issues as the old search_issues
endpoint is deprecated.
@wblondel
Copy link

wblondel commented Mar 18, 2025

Hey @skumar36-atlassian , thank you for your work!!

I'm not a maintainer of this repo but it seems a label is missing on this PR, preventing a check from passing. Could you add one? Options are bug, enhancement, major, minor, patch, skip-changelog.

Copy link

@wblondel, ⭐3 XP earned, 🏆First Comment Added completed!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

@skumar36-atlassian
Copy link
Contributor Author

/label enhancement

@skumar36-atlassian
Copy link
Contributor Author

Hey @skumar36-atlassian , thank you for your work!!

I'm not a maintainer of this repo but it seems a label is missing on this PR, preventing a check from passing. Could you add one? Options are bug, enhancement, major, minor, patch, skip-changelog.

Yes, I have tried to add /label enhancement as a comment and update the title with enhancement: keyword, also I am not seeing any option to update it to enhancement. @ssbarnea can you help here?

@skumar36-atlassian
Copy link
Contributor Author

@ssbarnea , @adehad , @studioj I don't have the necessary permissions to add labels to this PR. Could someone please add the "enhancement" label? Let me know if anything else is needed.

@skumar36-atlassian
Copy link
Contributor Author

@jeffgeorge , @wblondel ,@adehad, @ssbarnea any updates?

@wblondel
Copy link

I cannot do anything, I am not a maintainer.

@studioj
Copy link
Collaborator

studioj commented Mar 28, 2025

Heyhey, I'll have a look this evening... Let's see if we can get this on the main line.
I'm a maintainer but we're having release issues where @ssbarnea will need to help out with. He's the owner on pypi

Copy link

@studioj, ⭐3 XP earned, 🏆First Comment Added completed, 💪Level 3 achieved!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

Copy link

@studioj, ⭐3 XP earned, 🏆First Code Review Done completed, 💪Level 3 achieved!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

@skumar36-atlassian
Copy link
Contributor Author

Thanks @studioj for your approval.
@ssbarnea can you please approve and release this.

@ssbarnea ssbarnea merged commit 46943ba into pycontribs:main Mar 30, 2025
15 of 16 checks passed
Copy link

Pull Request Summary by devActivity

Metrics

Cycle Time: 12d 4h 31m Pickup Time: 11d 13h 49m Review Time: 14h 42m Comments: 12

Achievements

@ssbarnea ssbarnea changed the title enhancement: Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants