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

pass artifact name to argument for shell script

I have a plan that generates a single artifact. It has some <random name>.bit

In another plan I import this artifact. I need to pass the name and full path of that artifact to a script. I see that you can include arguments when calling a script but I don't know the variable name for the artifacts. I read up on the bamboo variables and did not see any mention of artifacts. 

I could use shell tricks to identify the artifact name and full path but I believe bamboo should have the exact details. 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Jeremiah Alfrey

You are correct, there is no variable for that specifically. Even though that is the case,  we can easily build paths with the following steps:

  1. Set a Destination path in your artifact download task (e.g. downloaded_artifacts). 
  2. All file paths could be built with:

Does that solution work for your case?


Assuming you consider this should be a feature in Bamboo, please feel free to raise it to our development team through

  1. Log in with your Atlassian user
  2. Click the Create button in the top of the page
  3. Select Bamboo (BAM) on Project field
  4. Select Suggestion on Issue Type field


I hope that helps.

When I download an artifact from other steps. It seems to come with the complete path where it was created in the previous project. In addition I am using wild card match to retrieve the artifact. This causes me to not know the complete file name. 

some dir/some sub dir/output dir/some weird filename.bit

all I know is I got *.bit

Got it! In this case, if the artifact path or filename does NOT have spaces I would use something like:

$(find ${}/downloaded_artifacts/ -name *\.bit)

(i) This line could be used as an argument of your script.


If the artifact path or filename has spaces, I would use this to get them quoted:

find ${}/downloaded_artifacts/ -name *\.bit > file
$(while read i; do echo \'$i\'; done < file)

(i) In this second example, the second line could be the argument of your script.


Let me know if that makes sense.

That is essentially what I had to do. My paths do not have spaces. I only used it as an example for easy reading. 

Like Daniel Santos likes this

I'm glad you have this solved. 
In case you want to open the feature request, please let me know if you need any help.

Suggest an answer

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

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

57 views 0 4
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