Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update bamboo project variable in a task

Jae Hun Lee August 1, 2021

I have a project variable to store an AWS access key. After rotate access key in task, I want to update the project variable with the new access key, is it possible? The variable is used in deployment projects to access to AWS resources.

1 answer

0 votes
Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 2, 2021

Plan execution can't update Project variable

Jae Hun Lee August 2, 2021

Thanks the answer.

Is there any way to update Project variables in AWS Lambda?

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 2, 2021

There's no REST API for project variable update available yet, but you can craft curl command to update it with multiform HTTP POST request

Like Steffen Opel _Utoolity_ likes this
Jae Hun Lee January 14, 2022

Thanks @Alexey Chystoprudov
I tried to find about the multiform HTTP POST request  but I counts't do it.
Could you give the information of multiform HTTP POST request to update?

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 17, 2022

Try something like this

curl -u user:password 'http://BAMBOO_URL/project/admin/ajax/updateProjectVariable.action?projectKey=PRJKEY' \
  -H 'x-atlassian-token: no-check' \
  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
  --data-raw ‘variableId=VARIABLE_ID&variableKey=myvar&variableValue=test2&bamboo.successReturnMode=json&confirm=true' 
Like Jae Hun Lee likes this
Jae Hun Lee January 17, 2022

Thanks, @Alexey Chystoprudov,

Could I use a personal access token instead of using -u user:password?

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2022

Unfortunately PAT doesn't work for non REST calls. 

By the way this feature is available by REST API since 8.1.1, see https://docs.atlassian.com/atlassian-bamboo/REST/8.1.1/#d2e288

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events