REST Import API?

Bryan Bush February 10, 2015

Is there a REST endpoint available for importing JSON formatted issues into JIRA in bulk?

We've got a handful of issues (~800) that we want to bring in from an old version of JIRA and JSON Export -> JSON Import seems to be the easiest way to accomplish this.  We've been able to export the data out of the old instance OK, but I'd prefer not to have to import them one-by-one into the new instance using the External System Import->JSON functionality provided by the JIM plugin.  I found this link that seems to suggest it's possible, but I don't see any importer endpoints on the REST API browser:

https://confluence.atlassian.com/display/JIRA/Importing+Data+from+JSON#ImportingDatafromJSON-RunningtheJSONFileImportWizard

If anyone has any ideas, they'd be much appreciated.

thanks,

2 answers

0 votes
Dharanitharan November 21, 2018

Przemyslaw: can you please explain me which json format you use to import the data

i want to know wheather it was this format: https://confluence.atlassian.com/display

/JIRA/Importing+Data+from+JSON

and it will be so helpful if you explain how

0 votes
pborkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 11, 2015

Hello Bryan,

I do believe that you have exported issue to JSON from JIRA via "Export" button and not used REST API to GET issues from it. I'm making this assumptions because JSON format of JIRA API and "Export" button is completely different.

There is a way to use REST to import JSON "Export" formatted issues. As I suggested in this comment, you are able to use it to import your JSON files one by one. If you have any problems with this process please let me know here and/or create issue in JIM project https://ecosystem.atlassian.net/browse/JIM

Bryan Bush February 11, 2015

Przemyslaw---thank you for your reply. We didn't exactly use the export button for these issues, we used curl like this: curl -o $ticket.json -k -D- -u bryan.bush:l@password -X GET -H "Content-Type: application/json" https://our-old-jira.com/si/com.atlassian.jira.plugins.jira-importers-plugin:issue-json/${ticket}/${ticket}.json I did see your previous comment (which is why I referenced it in the original question) but I do not see those endpoints (POST: jira-importers-plugin/1.0/importer/json) in the REST API browser (and there's no longer a button to toggle private APIs if it is hidden). I'd like to be able to use a similar curl to insert these old issues in if possible. What would be the full URL to use here? Thanks again for your assistance!

pborkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2015

Your way of exporting issues is also fine (it uses the Jira importers plugin) The JSON endpoints shouldn't be private - I'll need to look into that. We are fully supporting the JSON export-import endpoints, so you should be able to use them without any probelms. The full URL looks like this: If JIRA base URL is: http://example:8090/jira Then endpoint URL for importing is: http://example:8090/jira/rest/jira-importers-plugin/1.0/importer/json In response you will get an JSON object which contains full URLS with status and logs of your import. Please mind that only administrators can use this endpoints.

Dennis Worsham February 20, 2015

could you post an example or the POST request w/ sample data? For some reason I can't seem to get it to work.

pborkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2015

The above URL example should be correct, for sample JSON you can check our JSON documentation: https://confluence.atlassian.com/display/JIRA/Importing+Data+from+JSON . By the way, JSON REST endpoint is available since JIM 6.2.3 which is available for JIRA 6.2+, please make sure that you have updated the plugin to the newest version.

Bryan Bush February 23, 2015

Przemyslaw: Thanks again for providing the URL. I'll keep this in my back pocket in case we need it again. In the interim, we were able to accomplish our task by using some browser automation and looping over the import-by-JSON-upload function in the UI. Not the most efficient way, but it got the job done.

sclarke81 November 11, 2016

@Przemyslaw Are the import/export endpoints documented anywhere? I have been looking at the JSON import documents and REST API and this thread is the only place I've seen them mentioned.

sclarke81 November 22, 2016

Also is there a way to abort an import started through the REST API?

Guy Couronné April 4, 2018

@pborkowskiWhere do you find documentation about the REST API of JIRA Importer ?

Dharanitharan November 21, 2018

Przemyslaw: can you please explain me which json format you use to import the data

i want to know wheather it was this format: https://confluence.atlassian.com/display/JIRA/Importing+Data+from+JSON

and it will be so helpful if you explain how

Suggest an answer

Log in or Sign up to answer