HI,
using the api https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-postto create PRs, but if i add the reviewers attribute I get 400. in the documentation shows to use this partner { "title": "My Title", "source": { "branch": { "name": "my-feature-branch" } }, "reviewers": [ { "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}" } ] }is something broken in this api ?
and I check the api to get the pull resquests https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-getthats show the "reviewers": [ { "type": "<string>" } ], attribute in the docs. but the attribute is no coming.regards
Hi Hudson,
There is nothing broken with this API endpoint.
An example call with curl that works is the following:
curl --header 'Authorization: Basic redacted' -X POST https://api.bitbucket.org/2.0/repositories/my-workpsace/my-repo/pullrequests \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data '{ "title": "My Test PR", "source": {"branch": {"name": "feature-branch" } }, "reviewers": [ { "uuid": "{some-uuid}" } ] }'
A 400 error usually indicates a malformed request syntax.
Could you perhaps post here the call you are making, and replace the actual values of private/sensitive info with dummy values? We can then check if something is not correct in that request.
Kind regards,Theodora
Hello Theodora Boudale, run the example you put here and see it works, does not. I figured it out the error, lets see if you can find the error on your example, after you find, please update the documentation.
best regards,
I did run the request I posted it here and it was successful. The PR was created with the reviewer added.
If you believe you found an error, please feel free to share.
It looks like you're new here. Sign in or register to get started.