Can I assign a value to a bamboo variable in script?

I want to be able to use a script to parse a file, read out a value and then assign this value to a plan variable. I cannot see a way of assigning the variable however.

I have tried various scripts like:

Write-Output Initial Date: "${bamboo.CURRENT_ASSEMBLY_VERSION}"
set "bamboo_CURRENT_ASSEMBLY_VERSION=$rawVersionNumber"
Write Output Should have set to: $rawVersionNumber
Write-Output Using the shared assembly version number: "${bamboo.CURRENT_ASSEMBLY_VERSION}"

Is this possible with Elastic Bamboo?

3 answers

0 vote

Hi Mark,

It is currently impossible to change a variable value from within tasks while the build is running. This is being tracked here:

https://jira.atlassian.com/browse/BAM-10272

I would suggest adding any comments to the issue above as well as voting on the issue to create it's popularity and likelihood of being implemented in a future release.

For more information on how Atlassian implements new features and improvements please see the following document:

http://confluence.atlassian.com/display/DEV/Implementation+of+New+Features+Policy

Kind regards,
Felipe Kraemer
Atlassian Support

You can use the injection variable plugin to simulate this. Basically you write out to a text file, then read it in from the injection plugin task once it's there, you can use it as a variable within the same stage. I think you have to reload it in a new stage, which is a nuisance but works fine.

Ah, this plugin doesn't seem to be available for the cloud. We are running Elastic Bamboo. I thought that this meant that it is not currently able to be run with our version?

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,095 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