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 https://jira.atlassian.com/browse/BAM-21787 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.
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
Workaround
Use the following format:
/plan/{projectKey}-{buildKey}/variables?name=foo&value=bar
POST$ curl -H "Content-Type: application/x-www-form-urlencoded" -u admin:admin -X POST "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables?name=foo&value=var" <?xml version="1.0" encoding="UTF-8" standalone="yes"?><variable name="foo" value="var"/>GET
$ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [{"name":"foo","value":"var"}
Let me know if this helps!
Regards,
Khushboo Gupta
*please don't forget to Accept the answer if your query was answered**
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.