Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,931
Community Members
 
Community Events
184
Community Groups

Need to export all attachments from a single Project - JIRA Cloud

Is there any way I can export all Attachments from all tickets in a single project?  I have 706 tickets in a single project and need to export all attachments without going thru manually and doing so.  Is there any way to do this? 

Thank you!

Jacqy

4 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted

Hi @Jacqy George ,

I used the following solution a while back to export all attachments from JIRA OnDemand, I think it still might work for JIRA Cloud.

How to export attachments from JIRA OnDemand

Regards,

ILYA

Ting (Chiou Ting Teh)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 30, 2020

For Jira Cloud, can use this script written by one of the Atlassian Support Engineers to download the attachments from Filters.

https://bitbucket.org/snippets/atlassiansupportprojects/nedyBb/download-files-attached-to-the-issues

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 11, 2020 • edited

The script above was awesome, however it dumped all attachments into the same folder. I made some changes to allow it to download attachments for each issue into a directory named after the key.

It's a little rough, because I got hung-up on shell quoting/escaping and ended up hardcoding my username:api_token into the curl command. If anybody has more l33t shell scripting skills, please please let me know the fix.

downloadbykey.sh:

https://gist.github.com/darryllee/22ea98ccf639c303813a3ad4a2ad3480

And if you don't include the time I banged my head against the table figuring out the right arguments for jq and xargs, it's way faster than Ilya's method of running a backup and extracting the files from it.

On the other hand, Ilya's technique would have come in handy that time a project was accidentally deleted along with all the attachments. :-O

Like # people like this

Hi @Darryl Lee 

 

Thanks for providing the script.

 

Im attempting to use it. Im not familiar with scripts and was wondering if you're able to help me get it working. 

 

Have I got the correct values filled out?

Once I have the correct details do I just double click on it for it to run?

Where does it save the files in which directory?

 

Thanks

Snip20210720_12.png

I tweaked @Darryl Lee's script to save attachments using their original filenames:

https://gist.github.com/omegadrh/f4b3e43049b819ec18597c21f67578d4

 

@Hoc , if for some reason you're still interested in a response (or someone else with the same problem), I believe the likely issue with your screenshot is the presence of quotes around ARIB. You'd just want it to be "project = ARIB AND NOT attachments is EMPTY".

Once you have the correct details, you'll want to put this script in its own directory (e.g., 'Downloads -> attachments), open a terminal, navigate to that location (e.g., something like cd Downloads/attachments ), then run the command (without quotes) "chmod +x downloadbykey.sh"), and finally "./downloadbykey.sh" (again, without quotes). The attachments should appear in directories named after each issue key (e.g., ARIB-123). If you use my script, the attachments should have their original filename as specified in Jira; Darryl's script will name the attachments just as their Jira-internal attachment id number (e.g. 546793).

Like # people like this

Thanks @David R. Hedges for spending the time in replying. Its been a while since I posted. In the end I used a app to download all the attachments. I definitely have to give this a shot as a different option in case I need it in the future

 

Thank you once again for your help :)

0 votes
Answer accepted
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 02, 2018

Dear @Jacqy George,

two ways:

The rude one:

Go to the jira home's attachment directory and copy all files of the project. Disadvantage: you have not the original file names.

The api one:

Use the REST API search request to pull first all Jira issues of your project and then parse for each issue the attachment list. The JSON variable content keeps the URL to an attachment. Of cause the filename is also available. Then, one HTTP GET later for each attachment, you got them all.

So long

Thomas

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 06, 2018

Dear @Jacqy George,

how did you solve your issue? Do you need more help?

So long

Thomas

Hi @Thomas Deiler

We will try option 2, API but haven't had a chance to try this out yet. 

 

Thanks,

Jacqy

Ting (Chiou Ting Teh)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 10, 2019

The rude one:

Go to the jira home's attachment directory and copy all files of the project. Disadvantage: you have not the original file names.

If you're on Jira server, you can run this database command to get the to combine Unix command with the file name:

select ( 'mv ' || project.originalkey || '-' || jiraissue.issuenum || '/' || fileattachment.id || ' "' || project.originalkey || '-' || jiraissue.issuenum || '/' || filename || '"' ) as command from fileattachment join jiraissue on fileattachment.issueid = jiraissue.id join project on jiraissue.project = project.id where project.pkey = '<project-key>'; 

Example results:

mv PROJ-10/10031 "PROJ-10/screenshot-1.png"
mv PROJ-23/10000 "PROJ-23/screenshot2.jpg"
mv PROJ-23/10002 "PROJ-23/image.png"

Then run the command in terminal to rename your files.

Like # people like this

Thank you very much for the information, you have helped me complete a process.

Where can I find the Jira Home Attachments directory?

JIRA Administration-->System-->System Info-->File Paths

In our case: /var/atlassian/aplication-data/jira/data/attachments/

Regards.

@Ting (Chiou Ting Teh) You rocks!  Thank you very much. Your tip was very useful.

Hey Jacqy, 

did you manage to download all your attachments? If not there are also two Marketplace Solutions which should make this a breeze. 

If you use Jira Server have a look at Download Attachments. If you are on Jira Cloud check out Bulk Attachment Download.

Disclaimer: I am the developer of the cloud solution.

Hi Daniel,

I am trying to export all issues in 1 jira cloud project (with all attachments/images etc) and migrate them to another jira cloud project in a different instance. Can the Bulk attachment app attach all the image/files to each issue and upload them?

 

Thanks

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 25, 2021

For bulk import with attachments you can use CSV but you'll have to upload your attachments to a website that is accessible by Cloud.  Details here: https://support.atlassian.com/jira-cloud-administration/docs/import-data-from-a-csv-file/

You can use the Jira-Python library to do this.  The advantage here is that you could deliver your output in a way that suits you.  This example saves all of the attachments in subfolders by IssueKey under the Project name. 

 

Project Name

   -> IssueKey1

        -> Attachment 1

        -> Attachment 2

   -> IssueKey2

        -> Attachment 1

 

https://github.com/foundingpadres2/python-jira-exports/blob/1cb15e038f6c5caedc70c84f1556f59d205ae874/jira_attachments.py

i'm using Jira cloud. i'm not a developer by the way, So where do i add this python scripts in my Jira cloud to get the attachments as shown by you?