JSON export issue confluence links
Asked by Maxim Maximov:

Hi All,

Exported JSON for several issues does not contain links to the Confluence, which means they will be lost during migration of data of my Project from Jira Server to Jira Cloud.

I was looking through the atlassian confluence and looks like there is only ticket links supported by the JSON export/import.

Am I loosing something?


Answers:
author: Dario B
body: Hello [@Maxim Maximov](/t5/user/viewprofilepage/user-id/3511626) ,  
If my understanding is correct, you would like import issues from Jira Server into Jira Cloud by exporting to JSON, but this is not including the issue links to Confluence pages. Is this correct?  
If that's the case I have to indeed confirm that this functionality is no preset at the moment, but we have the below feature request open for it in our system:

* [\[JRACLOUD-73412\] Allow Links to Confluence pages to be exported/imported using CSV and JSON](https://jira.atlassian.com/browse/JRACLOUD-73412)

You may want to vote and watch the above feature request so that you will get notified in case of any update. The feature will be addressed according to the [Implementation of New Features Policy.](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html "https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html")

Possible workaround are the following:

1. You may want to check if the new tool we have built to facilitate the migration from Jira Server to Cloud ([Jira Cloud Migration Assistant](https://www.atlassian.com/cloud-migration/jcma)). The tool is still under development, so you may want to ask [@Jason Wong](/t5/user/viewprofilepage/user-id/510167) in the below threads if the tool is also migrating issues external/remote links.
   * [About the Jira Cloud Migration Assistant early access program](https://community.atlassian.com/t5/Jira-Migrations-Early-Access/About-the-Jira-Cloud-Migration-Assistant-early-access-program/gpm-p/1165638)
2. Extract all the links to confluence pages from the Jira Server DB table **remotelink** and then write a script to set them programmatically using the REST API endpoint to [Create or update remote issue links (POST /rest/api/3/issue/{issueIdOrKey}/remotelink)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-issueIdOrKey-remotelink-post). I might be able to help with this, if you decide to go this way.

Cheers,  
Dario

comments: author: Maxim Maximov
body: Hi Dario,

Your assumption is correct, I am trying to push project from Jira Server to Jira Cloud through the JSON export.

And JSON is not include links to Confluence and External links which could be painful for our data consistency.

Can you please explain two points:

1. As part of migration we also want to move Confluence Spaces from Server to Cloud. This could mean that the Confluence links (suggested to be pulled from the Database in p.2 above) will be different in the Cloud than they were in the Server. Can you please suggest solution here.

2. Can you please confirm that [(POST /rest/api/3/issue/{issueIdOrKey}/remotelink)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-issueIdOrKey-remotelink-post) also supports external WEB links.

Thanks and have a great day!


author: Dario B
body: Hi [@Maxim Maximov](/t5/user/viewprofilepage/user-id/3511626) ,

If you are actually planning to migrate both, Jira and Confluence, then there might be better ways to proceed. However, let me anticipate that in any case you will have to [open a support request with Atlassian Support](https://support.atlassian.com/contact/) to have the link URLs to Confluence pages fixed to point to the new locations.

Also, it might actually be a good idea to open a support ticket before starting the work since we have a dedicated team to help with migrations that will be able to suggest the best way to proceed in your specific case.

1. **Using backups only:**
   1. Create a Cloud instance having Confluence only (otherwise this procedure does not work).
   2. Export the full Confluence Server backup and import it into Cloud by following the instructions in: [Use Jira Site Import to migrate from server to cloud](https://confluence.atlassian.com/cloud/use-jira-site-import-to-migrate-from-server-to-cloud-972349848.html)
   3. Export full Jira Server backup and import it in Cloud as explained in: [Exporting issues](https://confluence.atlassian.com/adminjiracloud/exporting-issues-776636787.html)
   4. Open a ticket with Atlassian Support in order to have the links to Confluence pages fixed: <https://support.atlassian.com/contact/>  

2. **Using a mixed approach:**
   1. Migrate your Jira data to Cloud by following the instructions in: [Use Jira Site Import to migrate from server to cloud](https://confluence.atlassian.com/cloud/use-jira-site-import-to-migrate-from-server-to-cloud-972349848.html)
   2. Migrate your Confluence Server data using the [Confluence Cloud Migration Assistant app](https://confluence.atlassian.com/cloud/cloud-migration-assistant-for-confluence-973486571.html)
   3. Open a ticket with Atlassian Support in order to have the links to Confluence pages fixed: <https://support.atlassian.com/contact/>

Finally, you may want to review the below links since are providing a lot of details about the migration from Server to Cloud:

* [Migrate from server to cloud](https://confluence.atlassian.com/cloud/migrate-from-server-to-cloud-972330172.html)
* [Plan your cloud migration](https://confluence.atlassian.com/cloud/plan-your-cloud-migration-972349846.html)
* [Compare cloud migration methods](https://confluence.atlassian.com/cloud/compare-cloud-migration-methods-981151113.html)
* [Jira server to cloud migration resources](https://confluence.atlassian.com/cloud/jira-server-to-cloud-migration-resources-972330179.html)
* [Confluence server to cloud migration resources](https://confluence.atlassian.com/cloud/confluence-server-to-cloud-migration-resources-972330178.html)
* [Test your server to cloud migration](https://confluence.atlassian.com/cloud/test-your-server-to-cloud-migration-973495105.html)
* [FAQs about migrating to Jira or Confluence Cloud](https://confluence.atlassian.com/cloud/faqs-about-migrating-to-jira-or-confluence-cloud-978216197.html)

I hope this helps.

Cheers,  
Dario


author: Maxim Maximov
body: Hi [@Dario B](/t5/user/viewprofilepage/user-id/502402)

I raised request to Migration team of atlassian: <https://getsupport.atlassian.com/servicedesk/customer/portal/49/MOVE-5631>

Thanks for pointing this and thank you for attention to my current request.

Just to be clear about the migration from Server to Cloud which I am working on.

We have working and full of content Cloud Jira and Confluence and the task which I am performing now is to Merge into it (consolidate in one instance) our Jira Server and Confluence Server instance.

In this context it's still not 100% clear how to use [POST /rest/api/3/issue/{issueIdOrKey}/remotelink](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302&_ga=2.201179118.1734813753.1578238962-504270683.1562937616#api-rest-api-3-issue-issueIdOrKey-remotelink-post)suggested by you above. I mean for external URL (to google docs or some web pages) will retain the same, so I can use this approach. But Confluence URLs are going to change.

Thanks and waiting for your reply.

I am preparing this migration for the past 3 month and the timeline for completing it by 25.01.2020.


author: Dario B
body: Hi [@Maxim Maximov](/t5/user/viewprofilepage/user-id/3511626) ,

About the Confluence links:

If you were going to use the 1st approach I proposed, full backups, then the pages would have kept their IDs, only the first part of the URL would have changed and then we could either:

* change the URLs in the remotelink table in Jira Cloud (support could to this)
* extract a list of links for the desired issues from the remotelink table on Jira Server side, export to CSV (that has issue key and remote link to be created), create a script that takes the CSV in input and for each line run the REST API call to create/update the link to Confluence page

Without using the backup, but using either the migration assistant tool, or space to space export, the page IDs will be indeed different. However, in this case, the Migration team should have a script that compares the page names from source and destination Confluence (they will ask you to export some data from Confluence Server DB) to find the page IDs after the migration.

In any case, since you are already in touch with the Migration Team, I strongly advise to continue this conversation with them since they are the best resource to assist with this.

Cheers,  
Dario


author: Maxim Maximov
body: Hi Dario,

I get closer to the migration and reviewed do you provided and the API documentation: [POST /rest/api/3/issue/{issueIdOrKey}/remotelink](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302&_ga=2.201179118.1734813753.1578238962-504270683.1562937616#api-rest-api-3-issue-issueIdOrKey-remotelink-post) and looks like it's not exactly what I need. This is about creating links between tickets in the Jira:

"If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without values in the request are set to null. Otherwise, the remote issue link is created."

What I am looking for is to retain links which we have from the ticket to external resources like G-drive, One-drive, or some public WEB.

Is there any solution for this?


author: Dario B
body: Hi [@Maxim Maximov](/t5/user/viewprofilepage/user-id/3511626) ,

The endpoint [POST /rest/api/3/issue/{issueIdOrKey}/remotelink](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302&_ga=2.24074874.1536461939.1578996486-1080961822.1564054573#api-rest-api-3-issue-issueIdOrKey-remotelink-post) can also be used to create links to Confluence pages.

Please review below thread for details on how to do so:

* [how to link jira issue and a confluence page via rest](https://community.atlassian.com/t5/Jira-questions/how-to-link-jira-issue-and-a-confluence-page-via-rest/qaq-p/1125766)

Let me know if this helps.

Cheers,  
Dario


author: Itamar Ben Sinai
body: Hi [@Dario B](/t5/user/viewprofilepage/user-id/502402)

Can you add a DB query sample to pull the data from Mysql and a script sample to push the links to the cloud?

Thanks

Itamar


Tags: atl-adm

confluence-server

jira