azure-devops-dotnet-samples icon indicating copy to clipboard operation
azure-devops-dotnet-samples copied to clipboard

There is no sample for listing Policy Evaluations

Open JGCreator opened this issue 6 years ago • 3 comments

Documentation on "generating" an artifact id is unclear:

Evaluations are retrieved using an artifact ID which uniquely identifies the pull request. To generate an artifact ID for a pull request, use this template:

vstfs:///CodeReview/CodeReviewId/{projectId}/{pullRequestId}

And there is no example of how to do this in the repository.

JGCreator avatar Sep 17 '19 16:09 JGCreator

Same problem.

We don't know how to create the ArtifactId.

ADD-Juan-Perez avatar Sep 23 '19 12:09 ADD-Juan-Perez

@JGCreator @juanperezADD I see that this is an old thread. But I had run into this recently, and opened a dev community item. For the artifact id, you should in fact be using vstfs:///CodeReview/CodeReviewId/{projectId}/{pullRequestId} itself.

That was a bit confusing to me as well! Was initially trying out the artifact id of the PR being returned from Get PR rest api - in the format : vstfs:///Git/PullRequestId/{projectId}/{repositoryId}/{pullRequestId}

sreeraj-rajendran avatar Apr 08 '20 10:04 sreeraj-rajendran

Stumbled upon this as well. It's a little confusing that the PR API responds with fields like artifactId and codeReviewId but neither are used in policy evals for the PR.

We had to look at the repository of the PR, and then repository's project, to get its ID for the vstfs://CodeReview artifact for a policy eval.

jpreese avatar Apr 10 '20 15:04 jpreese