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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Dowload Plan Artifacts

An API to download the Artifacts of a plan . 

1 answer

0 votes

Hello @Vishal Gala,

Firs of all you need to know what job result from which you want to extract the artifact.

Let's say it is 

PROJ-PLAN-JOB-<BUILD_NUM>

Then you can list all the artifacts from it using:

curl -u <USERNAME>:<PASSWORD> -X GET \
<BAMBOO_URL>/rest/api/latest/result/PROJ-PLAN-JOB-<BUILD_NUM>?expand=artifacts

The results should include the artifacts section listing all artifacts and the links to access them:

<artifacts>
...
<artifact>
<name>fortune</name>
<link href="<BAMBOO_URL>/browse/PROJ-PLAN-28/artifact/shared/<ARTIFACT_NAME>/<ARTIFACT_FILE>" rel="self"/>
<producerJobKey>PROJ-PLAN-JOB-<BUILD_NUM></producerJobKey>
<shared>true</shared>
<size>105</size>
<prettySizeDescription>105 bytes</prettySizeDescription>
</artifact>
...
</artifacts> 

 Once you decide what artifact to download you can use the following command:

curl -u <USERNAME>:<PASSWORD> -X GET \
<BAMBOO_URL>/browse/PROJ-PLAN-<BUILD_NUM>/artifact/shared/<ARTIFACT_NAME>/<ARTIFACT_FILE> \
> <ARTIFACT_FILE>

Please notice that we are redirecting the output of curl to a file otherwise it would just trow the artifact content on the terminal.

⚠️In case you need a solution for Windows you might need to install curl and adjust the commands to match the Windows terminal needs.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

621 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you