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

enhancement: Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint #2324

Conversation

skumar36-atlassian
Copy link
Contributor

Overview

This PR introduces two new functions for Jira Cloud:

  1. enhanced_search_issues:
    This function leverages the new search/jql REST endpoint with nextPageToken-based pagination. It is designed to replace the deprecated search API endpoints (GET/POST /rest/api/3/search), which Atlassian has already deprecated and will remove support for on May 1, 2025. The function allows for either limited or complete fetching of results (when maxResults is set to false).

  2. approximate_issue_count:
    This new function calls the search/approximate-count API to retrieve an approximate count of issues matching a given JQL query. This endpoint is available only for Jira Cloud and is essential for users who need a quick estimation of matching issues.

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:
    • Returns either an integer count or the full JSON response based on the json_result flag.
  • Both functions are decorated with @cloud_api to ensure they are only used on Jira Cloud.
  • The new implementations are intended for Jira Cloud users, while Jira Server/Data Center users will continue using the existing APIs.

Testing & Limitations

  • Manual Testing: I have manually validated these changes against my Jira Cloud instance.
  • Unit Tests: Due to difficulties in configuring our testing environment for Jira Cloud (the existing tests are designed primarily for Data Center setups), I was not able to write complete unit tests for these cloud-specific endpoints. Further work is needed to establish a dedicated Jira Cloud test environment.

Migration & Impact

  • Breaking Change:
    Atlassian has already deprecated the old search API endpoints, and support for these endpoints will be removed 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 by these changes and can continue using the existing APIs.

Additional Context

  • This update aligns with Atlassian's decision to deprecate and eventually remove support for the old search endpoints, aiming for a more reliable and performant Jira Cloud experience.
  • 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.

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.
@skumar36-atlassian skumar36-atlassian requested a review from a team as a code owner March 17, 2025 12:38
Copy link

@skumar36-atlassian, ⭐3 XP earned, 🏆First Pull Request Pushed completed!
Contribute more to raise your XP/Level, complete challenges for extra achievements! [Sign up for personal dashboard]

icon

Copy link

Label error. Requires exactly 1 of: bug, enhancement, major, minor, patch, skip-changelog. Found: feature

@skumar36-atlassian skumar36-atlassian changed the title feat: Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint enhancement: Add enhanced_search_issues API for Jira Cloud using new search/jql endpoint Mar 17, 2025
@skumar36-atlassian skumar36-atlassian marked this pull request as draft March 18, 2025 05:31
Copy link

Pull Request Summary by devActivity

Metrics

Cycle Time: 19h 35m Comments: 2

Achievements

@skumar36-atlassian
Copy link
Contributor Author

Will be creating a new PR with a new label as it's failing the label check.

Copy link

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

icon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant