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
[BAM-21787] Bamboo REST API /plan/{projectKey}-{buildKey}/variables POST fails with json content type
Resolution | New: Fixed [ 1 ] | |
Status | Original: Waiting for Release [ 12075 ] | New: Closed [ 6 ] |
Status | Original: In Progress [ 3 ] | New: Waiting for Release [ 12075 ] |
Status | Original: Long Term Backlog [ 12073 ] | New: In Progress [ 3 ] |
Fix Version/s | New: 9.0.0 [ 100790 ] |
Assignee | New: Mateusz Szmal [ 851f15845f55 ] |
Remote Link |
New:
This issue links to "+core+ Dogfooding › Test Git Branch Detection › issue- |
Remote Link | New: This issue links to "Page (Confluence)" [ 659947 ] |
Status | Original: Needs Triage [ 10030 ] | New: Long Term Backlog [ 12073 ] |
Description |
Original:
h3. 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 h3. Steps to Reproduce {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [] {noformat} {noformat:title=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":"bar" }' You must enter a valid variable name {noformat} h3. Expected Results The variables should be added to the Plan h3. Actual Results The request fails with "You must enter a valid variable name" h3. Workaround Use the following format: * {{/plan/\{projectKey}-\{buildKey}/variables?name=foo&value=bar}} {noformat:title=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"/>{noformat} {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [{"name":"foo","value":"var"}] {noformat} |
New:
h3. 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 h3. Steps to Reproduce {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [] {noformat} {noformat:title=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 {noformat} h3. Expected Results The variables should be added to the Plan h3. Actual Results The request fails with "You must enter a valid variable name" h3. Workaround Use the following format: * {{/plan/\{projectKey}-\{buildKey}/variables?name=foo&value=bar}} {noformat:title=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"/>{noformat} {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [{"name":"foo","value":"var"}] {noformat} |
Description |
Original:
h3. 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 h3. Steps to Reproduce {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [] {noformat} {noformat:title=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":"bar" }' You must enter a valid variable name {noformat} h3. Expected Results The variables should be added to the Plan h3. Actual Results The request fails with "You must enter a valid variable name" h3. Workaround Use the following format: * {{/plan/\{projectKey}-\{buildKey}/variables?name=foo&value=bar}} {noformat:title=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"/>{noformat} {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [{"name":"foo","value":"var"}] {noformat} |
New:
h3. 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 h3. Steps to Reproduce {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [] {noformat} {noformat:title=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":"bar" }' You must enter a valid variable name {noformat} h3. Expected Results The variables should be added to the Plan h3. Actual Results The request fails with "You must enter a valid variable name" h3. Workaround Use the following format: * {{/plan/\{projectKey}-\{buildKey}/variables?name=foo&value=bar}} {noformat:title=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"/>{noformat} {noformat:title=GET} $ curl -u admin:admin -X GET "https://bamboo.mydomain.net/rest/api/latest/plan/ABC-DFG/variables" [{"name":"foo","value":"var"}] {noformat} |