Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-14276

Getting a "Bad Request" Error with API when Creating a Pull Request

    XMLWordPrintable

Details

    Description

      Getting a "Bad Request" Error with API when Creating a Pull Request

      #!bash
      #!/usr/bin/env bash
      set -o errexit
      set -o xtrace
      
      curl -X POST -H "Content-Type: application/json" \
       -u {username}:{password}\
       https://bitbucket.org/api/2.0/repositories/py-soft/sms_web/pullrequests \
       -d '{ "title": "Merge some branches", \
        "description": "stackoverflow example", \
        "source": { "branch": { "name": "TEST" }, \
        "destination": { "branch": { "name": "QA" } }, \
        "reviewers": [ { "username": "{username}" } ],\
         "close_source_branch": true }' > output.txt 2>&1
      
      #!bash
      
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
        0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
      100   267  100    11  100   256      3     87  0:00:03  0:00:02  0:00:01    87
      Bad Request
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            e5603a173689 Jeremy Hoyle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: