Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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

Extracting complete issue history via API


There are a lot of things that can be said when you have a history of such information. Given that Jira is a great piece of software, it provides a means whereby there's data integrity when something is changed within a project. The issue history feature by far is one of the most vital features that Jira has to offer. The complexity involved in recording data and the changes that took place makes it an integral part that shouldn't be easily manipulated.

Hence, I believe one of the fundamental things to keep in mind while moving from server to cloud is the ability to retain issue history. However this is a very complex process to do and in most cases, you end up not transferring this data due to the complexity involved.


Alternatively, it doesn't mean you can't extract such information from either a server to cloud instance or vice versa or even a cloud to cloud instance of Jira. The way to go about it, is to use Jira's REST API and the end result is an output in a CSV file which can be viewed from any spreadsheet application.

issue.pngMost of the API related instructions here are based on python examples using a specific package called jiraone (can be installed using pip install jiraone). Which can simply output a report file in CSV format. Example for Jira server instance given below

from jiraone import LOGIN, PROJECT

user = "username"
password = "password"
link = ""
LOGIN.api = False  # comment out line, if you want to extract history from a cloud instance
LOGIN(user=user, password=password, url=link)

if __name__ == '__main__':
    # the output of the file would be absolute to the directory where this python file is being executed from
    jql = "project in (PYT) ORDER BY Rank DESC"  # A valid JQL query

With the above, you will get a complete extract of all issue history in CSV format within the specified project listed in the JQL variable.


M Amine Community Leader Jun 09, 2021

Very interesting content

Hi Prince,

I have used this code and it runs well and gets the history of issues but at a certain point I get the error: "expecting value line 1 column 1 (char 0)" which is when the code stops running. Can I please get some help on how to go about fixing this error so that it does not interrupt the code from getting all of the issue history? Your assistance will be appreciated.

Hi @Tristan Munthree 

Please can you create an issue on the package in Github with the stack trace error, so I can trace where the error is coming from?

Hi @Prince Nyeche 

I have just created an issue with attachments showing the error, thank you for your prompt response.

Like Prince Nyeche likes this

Where should I run the script?

Can I do it directly on ScriptRunner?

No, this is a python script. You will need to install python on your device and run it from your terminal or if you have an IDE, you could run it from there too. 

@Prince Nyeche 

Thanks for your comments, I have tested the script and it works but does it have export limits?
I have to export the information of more than 1000 records, is this possible?
What do I have to modify in the code or where can I consult more information to achieve this?

Yes, there's no export limit. You can go to the doc

Hi @Prince Nyeche

When I run the code I get the error below

UnicodeEncodeError: 'charmap' codec can't encode character '\x95' in position 1114: character maps to <undefined>

I checked the issue and this happens because the custom field (objective) has bullets as example below


Do you know how can I solve this?

Hey @Miguel Angel Velazquez Solis 

It's suppose to try to convert that using utf-8 character encoding as that's the default on unix-like systems. However, I think if you're using windows this has to be explicitly mentioned when writing to a file. I'll push an update about this problem. Please can you create an issue here with the error that you received and I'll follow up with a resolution in the next update.

Hi @Prince Nyeche

Thank you so much 

I have already created the ticket in github.



How are credentials passed to the Project object?

The code above uses the `token_session` to initialize the `auth_request` attribute of the LOGIN class. But inside the PROJECT class the LOGIN class isn't ever initialized and no parameters are passed from the instantiated LOGIN class to the environment or PROJECT class in any way. 

How is this supposed to work?

I'm getting this error:

JiraOneErrors: <JiraOneError: Authentication failed. Please check your credentials.>


Hey Andrew,

Great question. To get the authentication to work, you need to instantiate the LOGIN  alias or class once hence the call

# previous login variables
(user=user, password=password, url=link)

Once that is done, you can access all the objects accessible to that class from anywhere within the code. The LOGIN alias is a global object for authentication that is used with the classmethod for Jira's API url called endpoint. So since the LOGIN performs authentication and HTTP requests, we can do something like after it's instantiated.


And since this is global when combined with the classmethod for each endpoint alias or class. This passes the entire session plus the endpoint class to the HTTP methods extracting the API contents. The PROJECT alias mostly being static doesn't really need instantiation. However, note that it is already instantiated automatically hence it can be called directly. With the above when combined together, each session is passed sequentially and the session lives in memory until the script is terminated or you terminate the connection or whatever objects you've called. Now, coming to why you get the error, there could be a number of reasons but the only thing that can cause that error is either a wrong email address or token (if on Jira cloud) or a wrong username or password (if on Jira server or DC).

If you're on Jira server or DC and using PAT, I think this might not work as I didn't test such authentication mechanism. So it's best to stick with username and password. OAuth 2.0 works as well but it was only tested on Jira cloud, so its mechanism might not work for Jira server or DC. Let me know if that answered your question.

Like Andrew Rainboldt likes this


Thanks for the quick response. Now I see the way LOGIN is created, via this

LOGIN = InitProcess()  

 and then re-instantiated when called. 

Thanks for the explanation.

Regarding the error, I'm just trying to access my company jira server with username and password as indicated in the example. 

I'm running out of Jupyter, perhaps something odd is happening there, but l've switched to cmd and the same error is coming up


Before calling the LOGIN alias since you're connected to a Jira server instance do the below

# previous login variables
LOGIN.api = False
(user=user, password=password, url=link)

As Jira server still uses v2 of Atlassian API. The attribute `LOGIN.api` changes the endpoints from api `v3` which works on cloud to `latest` which works on Jira server or DC. Probably that's why the auth keeps failing because it cannot connect at all.

Hey Prince,

thanks, authentication still doesn't work. It could be to do with the way my company manages accounts. 


Thanks anyway

Hello there,

I managed to connect to my company Jira Cloud instance using the API token ( but I still have the same error than Miguel:

UnicodeEncodeError: 'ascii' codec can't encode character '\u0117' in position 94: ordinal not in range(128)

Did you find any workaround for that @Miguel Angel Velazquez Solis ?



Hey, @Agnès Masson-Sibut  You should download the new version v0.7.3 which should fix the exception error of encoded characters.


Log in or Sign up to comment

Atlassian Community Events