No ideas left.
When I'm setting up request header field content-type to application/xml and setting proper content-length I'm recieving bad request 400 status code. Are there any special/mandatory fields need to be used for POST ?
Community moderators have prevented the ability to post new answers.
Hello Tomasz,
Just tested adding of build label by rest API at latest Bamboo 5.7.2
Used Chrome extension Simple REST Client
URL: http://localhost:6990/bamboo/rest/api/latest/result/BB-MR-2/label
Method: POST
Headers:
Data: <label name="xml_label" />
It requires authentication, so at first I logged in as admin at other tab.
Submitted result, received response 204. Refreshed build list and found that build #2 of MR plan has "xml_label" label.
Please let me know if you receive another result.
I'd like to add commandline example to what @Alexey Chystoprudov wrote:
curl -X POST --user admin:admin -H "Content-Type: application/json" -d '{"name":"new-label"}' http://localhost:8085/bamboo/rest/api/latest/result/FOO-BAR-2/label
I also suggest to always use JSON format which is lighter than XML
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked fine, but only for static strings, I had hard time with the variables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found a solution -d '{"name":"'"$VAR1"'"}' works for the variables.
Now I am finding that the label is changed to lower case, searching for the solution :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's working. Thanks guys. Looks like the crucial field for header is "Accept". Without it didn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.