Migrate Jira integration from deprecated API v2 to v3 endpoints#117
Migrate Jira integration from deprecated API v2 to v3 endpoints#117
Conversation
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
|
Cc/ @jacksonblalock |
There was a problem hiding this comment.
Pull request overview
Updates the Jira client initialization to target Jira REST API v3 endpoints, addressing failures caused by removed v2 endpoints in newer Jira environments.
Changes:
- Configure the python-jira
JIRAclient withoptions={"api_version": 3}.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.user = user | ||
| self.token = token | ||
| self.j = JIRA(url, basic_auth=(user, token)) | ||
| self.j = JIRA(url, basic_auth=(user, token), options={"api_version": 3}) |
There was a problem hiding this comment.
This hard-codes Jira REST API v3 for all deployments. The repo documentation and CLI/action inputs currently describe targeting a “Jira Server instance”; Jira Server/Data Center may not expose the v3 REST API, so this change could break those users. Consider making the REST API version configurable (e.g., input/env var with a default aligned to documented support) or implementing a simple fallback/auto-detect, and update the docs accordingly.
Atlassian removed Jira API v2 endpoints (
/rest/api/2/search,/rest/api/2/field,/rest/api/2/serverInfo) effective May 2025. The integration was failing with "The requested API has been removed. Please migrate to the /rest/api/3/search/jql API."Changes
options={"api_version": 3}to the JIRA client constructor injiralib.pyThis ensures all API calls automatically use the v3 endpoints:
/rest/api/2/search→/rest/api/3/search/jql/rest/api/2/field→/rest/api/3/field/rest/api/2/serverInfo→/rest/api/3/serverInfoOriginal prompt