fix(jira): migrate from deprecated API v2 to v3

Fixes #441. The JIRA REST API v2 /search endpoint has been deprecated
and returns HTTP 410 Gone. Migrate to API v3 /search/jql endpoint.

Changes:
- Update API endpoint from /rest/api/2/search to /rest/api/3/search/jql
- Add URL encoding for JQL query parameter (Python 3.14 compatibility)
- Add reference to Atlassian migration guide

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-01 21:02:20 -08:00
parent 2300514424
commit d213ec912b

View File

@@ -43,6 +43,7 @@ from pathlib import Path
from typing import List, Dict, Any, Optional, Tuple from typing import List, Dict, Any, Optional, Tuple
from urllib.request import Request, urlopen from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError from urllib.error import HTTPError, URLError
from urllib.parse import quote
def encode_base36(data: bytes, length: int) -> str: def encode_base36(data: bytes, length: int) -> str:
@@ -378,9 +379,10 @@ class JiraToBeads:
all_issues = [] all_issues = []
while True: while True:
# Use API v2 for broader compatibility # Use API v3 (v2 deprecated and returns HTTP 410 Gone)
api_url = f"{url}/rest/api/2/search" # See: https://developer.atlassian.com/changelog/#CHANGE-2046
params = f"jql={query}&startAt={start_at}&maxResults={max_results}&expand=changelog" api_url = f"{url}/rest/api/3/search/jql"
params = f"jql={quote(query)}&startAt={start_at}&maxResults={max_results}&expand=changelog"
full_url = f"{api_url}?{params}" full_url = f"{api_url}?{params}"
headers = { headers = {