2

On-prem server Bitbucket 6.10.

Referring to the API for adding default reviewers for a project.

POST Request:

https://git.company.net/rest/default-reviewers/1.0/projects/test-project/condition

Body:

{"sourceMatcher":{"id":"any","type":{"id":"ANY_REF"}}, "targetMatcher":{"id":"any","type":{"id":"ANY_REF"}}, "reviewers":[{"name": "p950a", "slug": "p950a", "id": 56111},{"name": "p950h", "slug": "p950h", "id": 45222}], "requiredApprovals":"0"}

It seems it's mandatory to pass "id" for each reviewer - "slug", "name" don't seem to work. I get the following error if "id" is excluded.

{
  "errors": [
    {
      "context": null,
      "message": "No user exists for identifier -1.",
      "exceptionName": "com.atlassian.bitbucket.validation.ArgumentValidationException"
    }
  ]
}

It's quite inefficient and tedious to retrieve IDs for several users, store them and then again iterate over that list to pass here. Is there a better way to do this or am I missing something?

Kaliyug Antagonist
  • 3,512
  • 9
  • 51
  • 103

0 Answers0