All Hello.
We have MS system with HR issues. We want moving this issues with attachments in JIRA. We can generate CSV file in format JIRA.
But, how move attachements?
Example from CSV
04/Mar/19 12:00;ape988955_;CV_Ivan_Ivanov.pdf;https://jira.host.net/secure/attachment/36608/CV_Ivan_Ivanov.pdf
But attachs dont create, why?
Hi Viktar,
The attachment cannot be imported because the URL is not publicly accessible when using a hosted location for the attachment URL the file is on a system that cannot be accessed by the destination system (exe: it requires a login to access the image)
When you upload to your files to the new server at $JIRA_HOME/import/attachments folder on the destination system you want to use FILE protocol and not the URL to another server or cloud site where the image is publicly hosted. The URL option is used when you have an alternate system still hosting the images that can be referenced to pull the file across noting the location must be accessible by the destination system directly without any permission redirects.
This is covered in the CSV import documentation "Importing data from CSV":
URLs for attachments support the HTTP and HTTPS protocols and can be any location that your JIRA server must be able to access. You can also use the FILE protocol to access files in the
import/attachments
subdirectory of your JIRA home directory.
The FILE protocol is initiated with "FILE://" and uses the relative path to the file based off of $JIRA_HOME/import/attachments base directory, So using your example URL and file name use this format and you should be good to go:
"file:///36608/CV_Ivan_Ivanov.pdf"
If you have a lot of files in your CSV that you are moving in one go rather than modifying each one individually the following KB article gives a search and replace command to convert the URL to to FILE protocol using sed
that will do this for the full file:
Append the attachments URL in the CSV file, to FILE protocol using
sed
. Carefully replace<jira-base-url>
in the command below, with the actual base URL of the source Jira. Appending the CSV file namedimport.csv
:sed -E 's@;<jira-base-url>/secure/attachment/([^/"])/.,@;file://\1,@' import.csv > new_import.csv
Regards,
Earl
@Earl McCutcheonThank you for the answer.
Can I use with file:// local PC path or no?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It's not possible to look in an alternate location. This is the path where Jira is looking for attachments when you specify:
file://example.png
It's looking for the relative path in your Jira home as the base location and translates to:
$path/to/jira-home/import/attachments/example.png
Regards,
Earl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.