JIRA import - get attachment URL's

Hey all,

We're migrating from RTC to JIRA. The attachments in RTC can be exported using the RTC API. We can then import into JIRA using the CSV import. Reference: https://confluence.atlassian.com/display/AOD/Importing+Data+from+CSV

Our RTC work items have attachment links in the in-line descriptions. i.e. a URI to where the attachment exists on the server. We need to migrate the URL of the in-line links to JIRA as well.

When we import our work items into JIRA (along with the attachment reference), the URL is as follows: https://jira:8080/secure/attachment/<someNumberHere>/<attachment_file_name>.

The problem we're having now, is that we have no idea what the JIRA-stored URL of the attachments are BEFORE we import. Therefore, we do not have a way to import the in-line descriptions/links.

Any thoughts?

2 answers

1 accepted

1 vote
Accepted answer
When we went from TRAC to JIRA, I dumped the attachments into folders based on the TRAC ticket numbers. After I imported the issues into JIRA, I wrote a Jelly script to attach the files in the folders to the appropriate issues. There might be a better way, but this worked well for a one-shot import.

Thanks for your reply, Jason.

We are able to get the attachments in there, but we're unsure how to migrate the in-line references (i.e. URL's of the attachments) to the new tool.

They're currently in the format of: https://org.jazz/etc..etc..., and if we migrated the text as-is, the references would be lost.

Is the last part of your hyperlink the actual filename of the attachment? If so, wiki markup is your friend.... you would just need to replace the "http" link in your descriptions/comments with a "[^yourfilenamehere]" link. This markup creates a hyperlink to a file attached to the issue.

How you would do a search and replace to fix all your descriptions now that they've been imported is another story. Not sure the best path, but if it were me I'd probably start trying to craft a Groovy script that uses the REST interface to step through and fix each issue with link. Maybe someone else could chime in with a better solution...

I believe our immediate blocker now is the JIRA link of the attachment, post-import.

When we import the attachments, the link to the attachment will be in the format of :

http://jira:8080/secure/attachment/<seemingly_JIRA_generated_attachment_name>/<image_name>.png

i.e.

http://jira:8080/secure/attachment/10109/capture-20130819-1533.png

That "seemingly_JIRA_generated_attachment_name" is the tricky part. We can't change our WI description`s to contain the new link due to the fact that we won`t know the attachment URL`s until we import. And even then, the path isn`t really clear. :(

Chris - That's what I'm trying to tell you. You shouldn't NEED the entire URL. If the file is attached to the issue, using a link like "[^capture-20130819-1533.png]" will resolve correctly. Or if you want to display the image inline (as opposed to just linking to it), use "!^capture-20130819-1533.png!".

Ahh, I see I see. That works for us in almost all cases. Sometimes attachments in one issue are referenced in other issues. At this point, we'd likely accept those as collateral damage as a result of migration.

Thanks many millions for your help Jason.

- Chris

Thanks for your reply, Jason.

We are able to get the attachments in there, but we're unsure how to migrate the in-line references (i.e. URL's of the attachments) to the new tool.

They're currently in the format of: https://org.jazz/etc..etc..., and if we migrated the text as-is, the references would be lost.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,711 views 17 21
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