Issue Summary
This is reproducible on Data Center:
When modifying Plan variables via the REST API https://docs.atlassian.com/atlassian-bamboo/REST/8.2.4/#d2e5901, Bamboo fails to create new variables when using a JSON content type reporting an HTTP 400 - "You must enter a valid variable name" error
Steps to Reproduce
GET
$ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" []
POST
$ curl -H "Content-Type: application/json" -u admin:admin -X POST "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" -d '{ "name":"foo", "value":"var" }' You must enter a valid variable name
Expected Results
The variables should be added to the Plan
Actual Results
The request fails with "You must enter a valid variable name"
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"}]
- mentioned in
-
Page Failed to load