How to upload attachments from the CSV file?

I have the following CSV file:

ID,"Type","Summary","State","Assigned User","Attachments"
125653,"Defect","Manager: GUI - Unable to start multiple stopped instances ","Accepted","Armen","190112.jpg"

It fails to upload the attachment. What is the workaround? What directory should the attached file be?

1 answer

This widget could not be displayed.

JIRA CSV Importer supports only file import via URLs. So in your CSV file you have to include full URL to each of the file you want to import. Then you have to expose your files via HTTP or HTTPS. You can easily try this out using dropbox.com - where files can be accessible via http. In normal production environment we would expect customers to expose these files via HTTP (or HTTPS) on some internal web server.

For Windows users (tried out on Win 7 Professional) you can quite easily do that without too much hassle:

  • make sure that IIS is installed
  • put all the files you want to import into some directory
  • in IIS add this directory to a new or existing web site
  • make sure your web site is started
  • you can click on a file from a IIS management console and "browse it" - it should open a web browser pointing to this file. If your web browser successfully downloads the file - you are ready to proceed with the import to JIRA - just use the same URLs in your CSV file

This article should help you http://support.microsoft.com/kb/323470 - just do not bother about security part - the best for this exercise is to allow anonymous access

file:// protocol is not supported due to security reasons - it would be possible to access any file from the server which JIRA instance is hosted. JIRA does protect local file system from being accessed. Even JIRA system admins can access normally only $JIRA_HOME directory and its subdirectories.

I've just realized that the documentation for this part of CSV importer needs improvement. That will be fixed.

Thank you, Wojciech. When I included the attachment url, JIRA added viewattachment under the Attachments and under Activity/Comments inserted the url for attachment but not file itself. Is it possible to insert the file? Then we do not need to keep the old defect tracking system just to access the attachment.

That's strange. The importer should copy the content of the files from given URLs. If it does not - that's looks like a wrong configuration or a bug in it. Could you raise a bug on https://studio.atlassian.com/browse/JIM and give there more details (including your cfg file, a screenshot of your field mapping screen, the etc.)?

I see the problem is in how we access the attachment. The url is

http://bel1app014:7001/im/viewattachment?issue=121549&attachment=bug121549.txt

where viewattachment is the script with 2 parameters added. JIRA considers the part before ? as the url to attachment and it strips the rest. Is there any workaround?

Thanks

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

86 views 0 1
Join discussion

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