【发布时间】:2019-06-08 13:43:14
【问题描述】:
我正在尝试使用 Powershell 中的 Azure API 对 PR 发表评论。
我已经实现了:
$postURL = "https://dev.azure.com/$organization/$project/_apis/git/repositories/$repositoryId/pullRequests/$pullRequestId/threads/$threadId/comments?api-version=5.0"
$prComment = Invoke-RestMethod -Uri $postURL -Headers @{Authorization = $pat} -Body $body
当我使用 $threadId = 1 运行它时,我得到:
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"The requested> pull request comment thread '1' 找不到。
当我使用$threadId = 0 运行它时,我得到:
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"值 0 超出允许范围
这是 id 为 1 的拉取请求的评论部分的图片:
那么,PR 的thread id 是什么?
【问题讨论】:
标签: azure azure-devops