Skip to content

[JIRA] Add search/jql and search/approximate-count APIs support for Jira Cloud #1513

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

Merged

Conversation

skumar36-atlassian
Copy link
Contributor

Overview

This PR introduces two new functions specifically for Jira Cloud to replace deprecated search APIs:

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).
  • Supports fetching a limited set or all results based on the batch size parameter.
  • Note: Atlassian will remove support for the old search API on May 1, 2025.

approximate_issue_count

  • Uses the search/approximate-count API to retrieve an approximate count of issues for a given JQL query.
  • Returns an integer count.

Changes

  • Added enhanced_search_issues to perform nextPageToken-based pagination for Jira Cloud.
  • Added approximate_issue_count to provide a quick issue count.
  • Both functions are decorated with @cloud_api to ensure they’re used only on Jira Cloud.
  • These updates ensure our library stays in line with Atlassian's deprecation roadmap, while Jira Server/Data Center users remain unaffected.

Testing & Limitations

  • Manual Testing: Both functions have been manually tested against a Jira Cloud instance.
  • Unit Tests: Due to challenges in configuring the test environment for Jira Cloud, full unit test coverage for these cloud-specific endpoints was not implemented. 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. Jira Cloud users must migrate to enhanced_search_issues and approximate_issue_count to ensure continued compatibility beyond May 1, 2025.
  • Jira Server/Data Center users are not affected and can continue using the existing APIs.

Additional Context

  • This update is in line with Atlassian's push for more reliable and predictable APIs for Jira Cloud.
  • For detailed information, please refer to Atlassian's deprecation roadmap and related documentation.
  • Your feedback is welcome – please review and let me know if any modifications are required.

Please review the changes and let me know if you have any questions or further suggestions. Thanks!

@skumar36-atlassian
Copy link
Contributor Author

These workflows requires approval from a maintainer.
@Viktxrrr , @SuperWonjune , @aaronsewall , @bigmac7 , can you review this PR?

@gonchik gonchik merged commit ff692bd into atlassian-api:master Mar 25, 2025
4 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants