Spartan87
Spartan87

Reputation: 119

Pullrequest to Bitbucket

I am looking to send pull request to multiple reviewers in bitbucket. Currently I have json and curl request as below

{
    "title": "PR-Test",
    "source": {
        "branch": {
            "name": "master"
        }
    },
    "destination": {
        "branch": {
            "name": "prd"
        }
    },

    "reviewers": [
        {

            "uuid": "{d543251-6455-4113-b4e4-2fbb1tb260}"
        }

    ],

    "close_source_branch": true

}

curl -u "user:pass" -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/companyname/my-repo/pullrequests -X POST --data @my-pr.json

The above curl command works. I need the json syntax to pass either multiple usernames or multiple UUID in the reviewers list.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests

Upvotes: 2

Views: 400

Answers (1)

user3657941
user3657941

Reputation:

The documentation you linked to seems to indicate that something like this should work:

"reviewers": [
    {
        "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
    },
    {
        "uuid": "{bafabef7-b740-4ee0-9767-658b3253ecc0}"
    }
]

Upvotes: 1

Related Questions