https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20q-6ren">
gpt4 book ai didi

azure - 如何使用 "Pull Request Query"?

转载 作者:行者123 更新时间:2023-12-02 23:01:57 25 4
gpt4 key购买 nike

我想根据提交返回拉取请求。我找到了这个 > https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20query/get?view=azure-devops-rest-5.1

This API is used to find what pull requests are related to a given commit.

我使用以下代码:

$body = @"
{
"items": [
{
"59c1c31397b266116ff6d735e5638ef5d1b598a0"
}
]
}
"@

$someLink = "https://dev.something.com/embrace/somethingSomething/_apis/git/repositories/****-bf64-47d9-8b10-53f21220d54d/pullrequestquery?api-version=5.1"
Invoke-RestMethod -Uri $someLink -Headers @{Authorization = $pat } -Body $body -Method Post -ContentType 'application/json'

当我运行该版本时,我得到:

The remote server returned an error: (400) Bad Request.

最佳答案

尝试使用以下正文:

$body = @"
{
"queries": [{
"items": [
"59c1c31397b266116ff6d735e5638ef5d1b598a0"
],
"type": "commit"
}]
}
"@

关于azure - 如何使用 "Pull Request Query"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59824836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com