How to import all tickets + attachments from a JIRA instance to another one

Hi,

I want to export a list of tickets from a JIRA instance and import them in another JIRA instance. I have tried saving tickets in a CSV file and importing the CSV fil. It effectively import the tickets but not their attachements. Is there a way to import all tickets + attachments in JIRA.

Regards,

Julien

6 answers

Comments Closed

@Julien73, I created a Python script for importing issues from one JIRA project to another with comments and attachments, see https://github.com/mrts/ask-jiraexport_import_issues_for_jql. Feel free to ask if you are unsure how to use it.

@Mart Sõmermaa - Hi Matt, great script and it works mostely perfect. ;-) The only issue I have is while adding the attatchment to the new Jira ticket. I always get an error 500 with an empty error text. Do you have any idea what could be the cause here?

I have identified the issue: The script currently doesn't support special characters like ä or é for attachment file names.

Thanks for the good words and for reporting the issue, Martin!

Please try the fix in this branch and see if if fixes the issue:

https://github.com/mrts/ask-jira/tree/attachment-normalize-filename

Here is the fix for review:

https://github.com/mrts/ask-jira/pull/2/files

Hi Mart, I have attempted to use this script to migrate a project from on JIRA instance to another everytime hit the following error:-

(venv) ➜  ask-jira git:(master) ✗ ./ask-jira.py export_import_issues_for_jql 'project=ACT AND issuetype not in subTaskIssueTypes() AND issuetype != Epic'
Traceback (most recent call last):
  File "./ask-jira.py", line 111, in <module>
    _main()
  File "./ask-jira.py", line 71, in _main
    command(jira, args)
  File "./ask-jira.py", line 58, in export_import_issues_for_jql
    exportimportconfig, args.jql)
  File "/Users/gluzangi/DevOps/ops.infra/jira.migrations/ask-jira/lib/export_import.py", line 8, in export_import_issues
    import_jira = JIRA({'server': import_conf.JIRA['server']},
AttributeError: 'module' object has no attribute 'JIRA'

Listing projects and fields is fine - this AttributeError: a module with a missing JIRA attribute appears during the export_import_issues_for_jql command. 

Any ideas/pointers to what is wrong with my execution?

 

Thanks 

Hi Gerald!

Sure thing,

'module' object has no attribute 'JIRA'

means that your exportimportconfig.py is missing JIRA configuration in JIRA variable, it should look like this:

JIRA = {
    "server": "https://example.com/jira/",
    "user": "user",
    "password": "password"
}
... other variables ...

An earlier version of README didn't have information about this and the example configuration file exportimportconfig-sample.py contained a misleading variable name. These issues have now been fixed.

Hope that helps!

Best,
Mart

0 vote
Colin Goudie Community Champion Mar 03, 2013

You can use JIRA's export/import project support. BUT, you first need to ensure a lot of configuration matches between the source and destination instances. (Such as workflows, CF's etc..)

We can help out with this as we have custom tools to do this, however, I also did spot this plugin which may help as well.

https://marketplace.atlassian.com/plugins/com.awnaba.projectconfigurator.projectconfigurator

0 vote
Yew Teck En Atlassian Team Mar 03, 2013
Hi julien, you can import attachment through csv file either using http protocol or file protocol. Check out this article and see if it's helpful: https://confluence.atlassian.com/pages/viewpage.action?pageId=307038033

Hi,

Thanks you for all your answers however I still don't have any solution to my problem:

I have tried the project configurator pluggin with the evaluation license but it seems the this licence gives only the ability to upload a file (import) and not to create the export file (export), which is not very helpfull...

I have checked the link to https://confluence.atlassian.com/pages/viewpage.action?pageId=307038033but this is a manual workaround that I can't use. I have more than 500 issues to export from a JIRA instance and re-import them in another instance. I can't manually copy the attached file in a folder and put the hyperlink in the CVS file for more than 500 issues. What I need is actually pretty standard : Importing an exporting all tickets data.

You say that you have custom tools to import/export a list of Issue. Can you please develop more about those tools. I really need to know which tools you are talking about.
- I used the basic export to excel on (Issues/View/Excel (All fields)) to create the csv file.
- I then go to Import & Export / Import external projects / Import projects and issues from a Comma Separated Values (CSV) file into JIRA to import the CSV file.
I have the issue imported but of course as the exported file is a CSV one, it does not import the attachements to the issues.

Regards,

Julien

Hi Mart,

I am facing below error while running 'export_import_issues_for_jql'.

AttributeError: type object 'PropertyHolder' has no attribute 'labels'

Can you please help me to resolve?

Details of the error:-

D:\jira-python\ask-jira>python ./ask-jira.py export_import_issues_for_jql "project = TMOVE AND issuetype not in subTaskIssueType
) AND issuetype != Epic ORDER BY key ASC"
About to export/import 50 issues
Exporting TMOVE-134 Traceback (most recent call last):
File "./ask-jira.py", line 133, in
_main()
File "./ask-jira.py", line 90, in _main
command(jira, args)
File "./ask-jira.py", line 59, in export_import_issues_for_jql
exportimportconfig, args.jql)
File "D:\jira-python\ask-jira\lib\export_import.py", line 15, in export_import_issues
_make_new_issues(source_jira, target_jira, issues, conf, result, None)
File "D:\jira-python\ask-jira\lib\export_import.py", line 24, in _make_new_issues
fields = _get_new_issue_fields(issue.fields, conf)
File "D:\jira-python\ask-jira\lib\export_import.py", line 66, in _get_new_issue_fields
value = getattr(fields, name)
AttributeError: type object 'PropertyHolder' has no attribute 'labels'

Thanks,

Sahidul

This is a four-year old thread, your question and/or answers are probably irrelevant.  I'd suggest asking a full question again for a wider audience and a more up-to-date answer

0 vote

Does anyone know if this works when transfering data from an old instance of Jira into a brand new one?

 

The old version is 

  • (v6.2.6#6264-sha1:ee76422) 

and the new version is 

  • (v7.2.8#72010-sha1:dc33de3) 

If you need to import attachments and you want to do that with the ask-jira script referred above, then yes, it works with the versions you listed.

This is a 4-year old thread, your question and/or answers are probably irrelevant.  I'd suggest asking a full question again for a wider audience and a more up-to-date answer

How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 4 hours ago in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

16 views 0 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you