0

I am trying to create a PR using Git Azure API

Azure git api documentation

Base on the documentation as part of the request body you have a field: vote that has these values:

Vote on a pull request:
10 - approved 5 - approved with suggestions 0 - no vote -5 - waiting for author -10 - rejected

I tried to pass a 10 but the PR is created but not approved. I want to approve the PR even if I get a conflict. Any idea of what am I missing here?

Zinov
  • 3,817
  • 5
  • 36
  • 70
  • Not get your latest information, is the answer below helpful for you? Or if you have any concern, feel free to share it here. – Vito Liu Apr 01 '21 at 05:44
  • I tested but it seemed to work but I try it again, and now I am getting an Authorization issue with the same token I have, let me see if I can post that later for you – Zinov Apr 01 '21 at 19:48
  • Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue? – Vito Liu Apr 06 '21 at 06:48

1 Answers1

0

Request URL

PUT https://dev.azure.com/{Org name}/{Project name}/_apis/git/repositories/{repo name}/pullRequests/{pull request ID}/reviewers/{reviewerId}?api-version=6.0

Request body:

{
  "hasDeclined": false,
  "id": "{reviewerId}",
  "vote": 10
}

Result:

PostMan

enter image description here

UI:

enter image description here

Vito Liu
  • 7,525
  • 1
  • 8
  • 17