How can I update the build status from Azure Pipeline to Bitbucket with a custom message and custom values? I've tried below APIs, but they didn't update the build status as expected. My goal is to see the build status reflected in commits and pull requests in Bitbucket.
`
curl -X POST -is -u <USER_NAME>:<APP_PASSWORD> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<USER_NAME>/<REPOSITORY_SLUG>/commit/<COMMIT>/statuses/build \
-d '{
"state": "SUCCESSFUL",
"name": "Build key - description",
"url": "https://<AZURE_URL_REFERENCE>",
"description": "A general description"
}'
`
Try adding the key attribute to the payload. It's just an arbitrary value.
curl -X POST -is -u <USER_NAME>:<APP_PASSWORD> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<USER_NAME>/<REPOSITORY_SLUG>/commit/<COMMIT>/statuses/build \
-d '{
"key": "my-build",
"state": "SUCCESSFUL",
"name": "Build key - description",
"url": "https://<AZURE_URL_REFERENCE>",
"description": "A general description"
}'
@sajo What's the response you get from the request? Any errors?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried to run curl via cmd line directly on your machine? Then you can inspect the output and see what the issue is?
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.