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 Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,096 views 0 5
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot