Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to get issue history with JIRA API?


I am a very new user to Jira and Jira API. I am required to export from JIRA website a bunch of issues history in an excel file. 

I have read in many forums that you need whether an extension or that I could write a request in Jira Api. As i am very new to Python and programming, i don't know how to write such a program using the url to extract all the issue history, I have tried but it is not working.

Could you please help me with the issue? 

PS: I want the issue history in order to figure the number of ticket reopening and there status (closed, resolved and closed)

2 answers

@Elshy do you can do it?

Can you share your solution, please?

yuliia_b__SaaSJet_ Marketplace Partner Oct 22, 2021

Hi @Caio Vinicius de Queiroz Luz 

If you'd like to export issue history for a list of issues, you can try the Issue History add-on. It provides a ticket history report of all changes that have been made in the selected list of issues. There is an option for export here.

issue history export.jpg

The app is developed by my team, so let me know if you have any questions.

0 votes

Hello @Elshy 

Welcome to the community

Are you sur that you need to use API for this. It seems that you just need to write a JQL to be able to find the number of ticket.

Closed ticket :

project = "ABC" ans status in ("Closed")

 Resolved ticket :

project = "ABC" and resolution in ("Resolved")

 reopened ticket :

project = "ABC" and status changed from "Closed" to "Reopen"

 You can add date to narrow your search :

project = "ABC" ans status in ("Closed") and createddate >=StartofMonth(-1) and createddate <= EndofMonth(-1)

This query will find all issue closed in the project ABC that where created the previous month.

With JQL you will be able to export your result in CSV.


Hope this helps



Thanks for your kind help and sorry for my late answer.

Unfortunately i already tried this, it worked but it does not give me what i want. What i am looking for is how much items have been reopened (what the Jira query gives) but also HOW MANY times an item as been reopened (most of my items have been reopened twice), as i have almost 500 items i would like to avoid doing it manually... My final aim is to calculate a reopen rate....


If you have any idea on how to help with these precision i would be really happy :)

Here is the python i tried to write but as i am very new to python and programming it kept failing hahaha...



import requests
import json
from openpyxl import load_workbook
import html
from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font, NamedStyle
import datetime
from openpyxl.styles.colors import ColorDescriptor, Color
import pandas as pd
from pandas import ExcelWriter
from pandas import ExcelFile

headers = {
'proxy-authorization': 'Basic UElENjNEQjpQYXNzd29yZDEyMzQ=',
'authorization': 'Basic UElENjNEQjpQYXNzd29yZDEyMzQ='

Today = str(".")[0].replace(':', '_')
wb = load_workbook(filename='C:/Users/ESABIRB/Desktop/Issuehistory.xlsx')

wb = load_workbook(Excel)
EX = wb['JiraData']

r = requests.get('', headers=headers, verify=False)
issue = requests.get('', headers=headers, verify=False, expand='changelog')
#issue = r.issue('NGT-25021', expand='changelog')
changelog = issue.changelog

for history in changelog.histories:
for item in history.items:
if item.field == 'status':
print ('Date:' + history.created + ' From:' + item.fromString + ' To:' + item.toString)

Like Matthew Korich likes this

Hello @Elshy 

Here a code, i used the jira modul for python :

from jira import JIRA
jira_server = JIRA(basic_auth=("username","password"), options={'server''https://URL'})
issues_Jql = jira_server.issue('your issue',expand='changelog')#pass one issue at the time  
changelog = issues_Jql.changelog
count = 0
for history in changelog.histories:   
for item in history.items:        
if item.field == 'status':            
if item.toString == "Reopened":                
count = count + 
Like # people like this


thanks again for this very useful help. One last question do you know what i should put instead your issue to have the number for all issues?


Thanks a lot :)

Hi, you need something like that:

dictionnary = {}
 i in jql_search:    
count = 
for history in jira_server.issue(i.key, expand = 'changelog').changelog.histories:              
for item in history.items:                   
if item.field == 'status'                       
if item.toString == "Done":
count += 
dictionnary[i.key] = count      

Hope this helps

Like # people like this

Hi - My name is Gopinath. RG, i am new to python i need help in pulling histories of all jira issues where item.field = status, i am using below code

from jira import JIRA
from pandas import pandas as pd
jiraOptions = {'server': ""}
jira = JIRA(options=jiraOptions, basic_auth=("username", "password"))
Status_History = pd.DataFrame(columns=['Key','Changed Date','Status From','Status To'])


jql='project in (project) AND (component not in (TEST_DATA) OR component is EMPTY) AND "Team[Team]" in (1694, 1695, 1696, 1697) ORDER BY project DESC, due DESC, key DESC, status DESC, created ASC, priority DESC'
dictionnary= []
for singleIssue in jira.search_issues(jql_str=jql, expand='changelog'):
count = 0
issue = jira.issue(count, expand='changelog')
changelog = issue.changelog
for history in changelog.histories:
for item in history.items:
if item.field == 'status':
count += 1
Status_History.loc[len(Status_History.index)] = [issue.key,history.created,item.fromString,item.toString]


i have some 5500 issues, but i am getting only 31 results, once i execute the above code, can you please help me to get all histories of all issues. Thanks.

Suggest an answer

Log in or Sign up to answer