Bamboo: Download multiple Artifact file
Asked by Sriman Padmanaban:

Is it possible to download an artifact generated by a build plan if it contains more than one file? We have artifacts that consist of multiple files and there seems to be no easy way to download them. When we click on the artifacts link we can see the artifact directory structure in the browser and download one file at a time, but there is no link to download the entire artifact all at once. Do you have any API which returns the list of filenames inside the directory structure?


Answers:
author: Jimmy Seddon
body: Hello [@Sriman Padmanaban](/t5/user/viewprofilepage/user-id/4633080),

Welcome to the Community!

I believe what you are looking for is: <https://jira.atlassian.com/browse/BAM-12456>

I would also agree with one of the workarounds listed in that request. Which is to zip the directory of files as a part of your build process and have Bamboo save that zip file so you can download it as a single artifact.

If you are looking at the APIs, I'd recommend starting here:   
<https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/#d2e1824>

I hope that helps!

-Jimmy

comments: author: Sriman Padmanaban
body: Hello [@Jimmy Seddon](/t5/user/viewprofilepage/user-id/512822) ,  
Thanks for the response.  
Yes, I understand that the workaround to download the file is to zip it and store it as a single artifact. However, I don't want to download all the files at once. All I need is an API giving me the list of filenames inside the Artifacts.

For Eg: I have an artifact called SampleMultipleFile. Inside the Artifact, I have 3 files say sample1.xml,sample2.xml,sample3.xml. If there is an API that can give me the list of file names based on some validation in file names i will download the necessary files. (Right now all I get is an HTML file that contains the file names)

Can you please let me know if there is an API for the same?


author: Jimmy Seddon
body: Hey [@Sriman Padmanaban](/t5/user/viewprofilepage/user-id/4633080)

As I mentioned previously, I'd start by looking at the API docs:

<https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/#d2e1904>

The above like with get build results metadata, you probably want to specifically expand the artifact listing.

From there, this API should allow you to retrieve specific artifacts:

<https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/#d2e1824>

I hope that helps!


author: Sriman Padmanaban
body: Hello [@Jimmy Seddon](/t5/user/viewprofilepage/user-id/512822) ,  
Thanks for the quick response.   
Yes, I looked at your API

<https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/#d2e1824>

This API gives me the list of Artifacts that are created as a part of the Build Plan.

The response of this API gives me the metadata of artifacts.

<https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/#d2e1904>

Eg:   
\`\`\` {  
"name": "test-multiplefile",  
"link": {  
"href": "<http://Bamboourl/browse/TST-BEAG-29/artifact/shared/test-multiplefile/>",  
"rel": "self"  
},  
"producerJobKey": "TST-BEAG-TST-29",  
"shared": true,  
"size": 15562,  
"prettySizeDescription": "15 KB"  
} \`\`\`   
It just give me the folder of the artifacts.   
I want to know the list of filenames inside the test-multiplefile folder.

Please help me on this.