-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_search.py
More file actions
26 lines (22 loc) · 765 Bytes
/
debug_search.py
File metadata and controls
26 lines (22 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import requests
from requests.auth import HTTPBasicAuth
from dotenv import load_dotenv
load_dotenv()
domain = os.getenv("JIRA_DOMAIN", "petri-paananen.atlassian.net")
email = os.getenv("JIRA_EMAIL")
token = os.getenv("JIRA_API_TOKEN")
url = f"https://{domain}/rest/api/3/search"
auth = HTTPBasicAuth(email, token)
params = {"jql": "project = 'KAN'", "maxResults": 1}
print(f"Testing Search API: {url}")
try:
response = requests.get(url, params=params, auth=auth)
print(f"URL: {response.url}")
print(f"Status: {response.status_code}")
if response.status_code != 200:
print(f"Response: {response.text}")
else:
print(f"Total Issues: {response.json().get('total')}")
except Exception as e:
print(f"❌ Error: {e}")