Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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)

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 + 


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

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you