如何在不使用线程的情况下在请求请求中创建注释

时间:2019-07-15 07:11:00

标签: azure azure-devops

我有一个脚本,该脚本将线程发布到拉取请求中:

$createThreadInPRUrl = "https://dev.azure.com/$organization/$project/_apis/git/repositories/$repositoryId/pullRequests/$pullRequestId/threads?api-version=5.0"
Invoke-RestMethod -Uri $createThreadInPRUrl -Headers @{Authorization = $pat } -Body $body -Method Post -ContentType 'application/json'

$body = @"
    {
        "comments": [
            {
                "content": "
                    \nLink to feature release $env:featureReleaseUrl\nOne or more Cypress tests failed.\nLink to Cypress test results $cypressResultatenUrl",
                "CommentThreadStatus": "closed"
            }
        ]
    }
"@ 

这很好用:

enter image description here

但是我不想使用线程。我想创建类似提交更新的内容:

enter image description here

我可以使用哪个API调用来做到这一点?

0 个答案:

没有答案