Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with new Jira REST API GET calls

Rahul Ghelani
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2025

Hello. I am facing issues while trying to make GET calls using Jira REST APIs via python scripting. It was working fine until the older APIs were deprecated. Based on the documentation - The Jira Cloud platform REST API, I tried writing a code snippet to simply fetch issues based on a query. It fails to provide any response. I am not sure what is it that I am doing incorrectly. Can someone please help and suggest a fix? Thanks!

Below is the code snippet:

import requests
from urllib.parse import quote

# Jira Cloud details
JIRA_URL = "<Cloud URL>"
API_TOKEN = "<API_TOKEN>"
EMAIL = "<EMAIL>"
JQL = "project = DPLY and fixversion = '2025-Q4'" # Example JQL

# Encode the JQL query
encoded_jql = quote(JQL)

# Pagination settings
start_at = 0
max_results = 50 # Adjust as needed

headers = {
"Authorization": f"Basic {requests.auth._basic_auth_str(EMAIL, API_TOKEN)}",
"Accept": "application/json"
}

while True:
url = f"{JIRA_URL}/rest/api/3/search/jql?jql={encoded_jql}&startAt={start_at}&maxResults={max_results}"
response = requests.get(url, headers=headers)
data = response.json()

issues = data.get("issues", [])
if not issues:
break

for issue in issues:
print(issue["key"], issue["fields"]["summary"])

start_at += max_results
if start_at >= data.get("total", 0):
break

1 answer

0 votes
Jeroen Poismans
Community Champion
November 7, 2025

Hi!

Might I suggest a different approach? I use the atlassian-python-api package:

import json
import pandas as pd
from atlassian import Jira

# === Authenticate using API token ===
jiraSandbox = Jira(
    url=JIRA_BASE_URL,
    username=EMAIL,
    password=API_TOKEN
)

JQL_getIssues = "project = XYZ"
all_issues  = []
start_at    = 0

while True:
    print(f"Fetched {start_at}")

    jql_resp = jiraSandbox.jql(JQL_getIssues, start=start_at, limit=100)
    issues = jql_resp.get('issues', [])
    if not issues:
        break

    all_issues.extend(issues)
    start_at += len(issues)

    if start_at >= jql_resp.get('total', 0):
        break

print(f"Total Fetched {len(all_issues)}")

Link to the documentation of the api:
https://pypi.org/project/atlassian-python-api/

Give it a try!

 

Rahul Ghelani
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2025

Hi @Jeroen Poismans . Thanks for sharing a sample snippet. I got the below error when I tried to run it:
Jira_Error.png

New Jira API documentation - The Jira Cloud platform REST API

Jeroen Poismans
Community Champion
November 7, 2025

Hm, that is weird, the atlassian-python-api is still maintained and updated, but this change is apparently not in it yet. Let me check on that.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events