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

Rest Api failed with "You must enter a valid variable name" when send json data

sunil jaiswal September 19, 2023

I am using bamboo 8.2.5 and when I made the the post request to 

/plan/{projectKey}-{buildKey}/variables it failed with an error saying "

You must enter a valid variable name" When I googled I found this It indicates that it's a bug but just want to check if we have any alternate way to add variables to the newly created branch plan.
Can anyone share some other method for this.

1 answer

1 vote
Khushboo Gupta
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 19, 2024

Hello @sunil jaiswal 

It seems like you're trying to programmatically add variables to a new branch plan in Bamboo. Unfortunately, as you've discovered, there is a known bug (BAM-21787) in the REST API that prevents this from working as expected.

Please try the workaround given in the BAM


Use the following format:


$ curl -H "Content-Type: application/x-www-form-urlencoded" -u admin:admin -X POST ""
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><variable name="foo" value="var"/>
$ curl -u admin:admin -X GET "" [{"name":"foo","value":"var"}


Let me know if this helps!


Khushboo Gupta

*please don't forget to Accept the answer if your query was answered**

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events