Skip to content

Conversation

@leesmith110
Copy link
Contributor

@leesmith110 leesmith110 commented Oct 28, 2025

Description

This PR updates the Jira alerter to align with Atlassian’s JQL search API deprecation - Deprecation of JQL search and Evaluate expression endpoints (effective May 1, 2025) by using the Jira client’s enhanced_search_issues for bumping behavior.

  • Always use enhanced_search_issues(JQL) to find existing tickets
  • Remove legacy search_issues fallback and any HTTP/manual paths
  • Raise a clear error if enhanced_search_issues is unavailable
  • Update docs and changelog to reflect the change and minimum client version
  • Minimal, self-contained edits; no configuration changes required

Notes:

  • requirements.txt already specifies jira>=3.10.5, which includes enhanced_search_issues
  • This makes the migration transparent for default installs

Breaking changes:

  • None for environments using jira>=3.10.5. Older client versions will be prompted via a clear error to upgrade.

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

  • None.

…nctionality

- Added a notice in the changelog and documentation regarding the deprecation of legacy JQL search endpoints by Atlassian, effective May 1, 2025.
- Updated the JiraAlerter to use the new  method when available, with a fallback to the legacy  method.
- Enhanced error handling for search methods in JiraAlerter.
- Added tests to verify the new search method behavior and error handling.
- Updated requirements to use jira library version 3.10.5 for enhanced API support.
- Modified JiraAlerter to force the use of the enhanced_search_issues method and raise an exception if not available.
- Updated tests to reflect changes in the search method behavior and ensure proper error handling when the enhanced method is unavailable.
- Revised changelog and documentation to clarify the deprecation of legacy JQL search endpoints by Atlassian, effective May 1, 2025.
- Updated language to specify the use of the Jira client's enhanced_search_issues method for ticket bumping, ensuring transparency for users with compatible library versions (3.10.5+). No configuration changes are required.
@jertel
Copy link
Owner

jertel commented Oct 28, 2025

Thanks for submitting this, Lee. Will you please move the changelog entry to the bottom of the "Other changes" section, so that they are in ascending ticket order?

Also, I see references to test.atlassian.net in the unit tests. Is that hostname accessed over the Internet when the unit tests run? I see there are also mocked responses so I wasn't sure.

@leesmith110
Copy link
Contributor Author

@jertel

Moved the changelog entry to the bottom of the "Other changes" section.

Regarding test.atlassian.net:
No, test.atlassian.net is not accessed over the Internet in the unit tests.
The tests use mock.patch('elastalert.alerters.jira.JIRA') to mock the JIRA client, so no real HTTP requests are made. test.atlassian.net is only used as a placeholder hostname in test rule configurations (e.g., 'jira_server': 'https://test.atlassian.net'). All JIRA client methods (enhanced_search_issues, priorities(), fields(), etc.) are mocked and return test data.
The tests are isolated and do not make external network calls.

@jertel jertel merged commit 0e5385b into jertel:master Oct 31, 2025
1 check 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