microsoft / azure-devops-dotnet-samples

.NET/C# samples for integrating with Azure DevOps Services and Azure DevOps Server
https://docs.microsoft.com/azure/devops/integrate
MIT License
519 stars 511 forks source link

Update the vote on GitPullRequest #303

Open smg-bg opened 3 years ago

smg-bg commented 3 years ago

I was trying to update the vote for the currently authenticated user. If I use:

var updatedVote = new[] { new IdentityRefWithVote { Id = _connection.AuthorizedIdentity.Id.ToString(), Vote = 10 } };

await _gitClient.UpdatePullRequestReviewersAsync(updatedVote, repositoryId, pullRequestId);

I'm getting a:

Microsoft.VisualStudio.Services.Common.VssServiceException: 'Invalid argument value. Parameter name: You can only reset votes to zero (NoVote) using this REST call. You cannot vote for another user.'

I would appreciate any ideas / suggestions?