The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i change a plan variables in tasks

appregidc
October 19, 2016

hello, how can i change a plan variables in tasks? or is plan variables == const? 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2016

Maybe you should look at https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin/server/overview which handles this problem elegantly and you can limit the scope of visible change just for the scope of the job execution.

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2016

Hello,

This is what you cannot do:

# in a Script task
${bamboo.myGlobalVariable} = 'new value'
${bamboo.myPlanVariable} = 'new value'

This is what you can do:

  • Running a plan build manually, by running a customised build
  • running a cURL command to run a particular build overwriting a Global/Plan variable

    curl -u USERNAME:PASSWORD -X POST -d 'bamboo.yourVariable=newValue' 'http://localhost:8085/rest/api/latest/queue/PROJ-PLAN'

    The above will trigger a build 'PROJ-PLAN' and will overwrite the variable 'yourVariable' with 'newValue'.

  • Injecting Bamboo Variables

Kind regards,
Rafael P. Sperafico

Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2016

Yes it is possible but IMO you should not do it. This can easily lead to chaos in your build configuration.

TAGS
AUG Leaders

Atlassian Community Events