Bamboo Plan Variables not working for me

I am having trouble making use of Plan Variables in Bamboo.

I added a plan variable, name: stuff, value: 1.2.3

 

In my "Default Job", I have a Script (File) task calling a command line utility, passing in a few parameters, including: ${bamboo.stuff}

Unfortunately, what is being passed is "${bamboo.stuff}", not "1.2.3"

Other built in bamboo properties are being passed in just fine, just not my plan variable.

I've tried: ${stuff}, $stuff, $bamboo.stuff, ${bamboo_stuff}, %STUFF%, %BAMBOO_STUFF%, and others, but I can't get it to respond.

What am I doing wrong?

2 answers

If it is Unix  — you should call ${bamboo.stuff}

windows -   %bamboo.stuff%

within java -   bamboo_stuff

These all worked for me.

If above does not worked, send me the version of bamboo, platform on which it is running and screenshot of variable and script.

 

Thanks

Siddu

Sorry, forgot to mention I'm in Windows.

The Script Task uses File as its location, and as an example of my Argument value:

-root="${bamboo.build.working.directory}" -test=${bamboo.stuff} -revision=${bamboo.repository.revision.number}

What I get passed to me, root and revision are replaced correctly.  But for test ==> ${bamboo.stuff}

Bamboo 5.11.1.1 (but still in trial-mode)

Capture.PNG

Using ${bamboo.stuff} will only work if you use the Script Task with an inline script.
Bamboo will replace any variable references it sees there before it starts running the script.
If you let the Script Task with the script in a file, Bamboo will not get a chance to replace the variables.

So one solution would be to use an inline script instead of a file.

If you need to stick to a file script, you need to use the environment variables that Bamboo creates.
In your case you should be able to reference the variables with %BAMBOO_STUFF%.
You wrote that you already tried that, but it didn't work.
To investigate this, you can add a simple Script Task that just calls "set".
In the build log you can then see all environment variables. 

I tried your SET idea, and though it listed out nearly 100 items, "stuff" is nowhere in the list.  sad

For Linux style inline script, the ${bamboo.stuff} syntax did NOT work for me, that is when I do the following in my inline script

STUFF=${bamboo.stuff}

I get...

${bamboo.stuff}: bad substitution

Suggest an answer

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

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

185 views 4 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