Bitbucket Server 5.16.0 won't except the API change to update auto-unapprove setting

Issue #45 resolved
Former user created an issue

I have 70+ project repositories. I need to have the repos flagged=true for the pull request setting "Unapprove automatically on new changes". I executed the following command which returns HTTP/1.1 200, but the setting remains false (box is unchecked).

curl -u user:passwd -X PUT -H "Content-Type: application/json" -d '{"unapproveOnUpdate": "true"}' http://bitbucket.domain.com/rest/api/1.0/projects/test/repos/test1

Comments (3)

  1. Kristy Hughes

    Hi, it looks like your URL is incorrect (missing /settings/pull-requests off the end), and you're using PUT instead of POST.

    It should be:

    curl -u user:passwd \
        -X POST \
        -H 'Content-Type: application/json' \
        -d '{"unapproveOnUpdate":true}' \
        https://bitbucket.domain.com/rest/api/1.0/projects/test/repos/test1/settings/pull-requests
    

    Hope that helps!

  2. Kristy Hughes

    Additionally, we have now implemented project level settings in this plugin (issue #16), so if you upgrade to the latest version of the plugin you should be able to configure the default settings in the UI at the project level (for all repos in that project) or at the global level (for all repos everywhere).

  3. Log in to comment