运行“PUT”在 Azure DevOps 上使用 Rest-Api 进行请求
我正在尝试使用 Postman 运行 PUT 请求,以更改 Azure DevOps 中特定生成定义的保留规则,并更改 daysToKeep 值。
但我不断收到错误: “请求指定管道 ID 1722,但提供的管道 ID 为 0。”
知道我哪里出错了吗?
I'm trying to run a PUT request using Postman to change the retention rules of a specific build definition, in Azure DevOps, and change the daysToKeep value.
But I keep getting the error:
"The request specifies pipeline ID 1722 but the supplied pipeline has ID 0."
Any idea where do I go wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了更改/更新构建定义上的任何参数,请首先运行 GET 请求。
结果 JSON 输出应用作 PUT 请求的正文。
使用此主体并更改\更新您需要的相关参数...
增加位于 1 中 JSON 输出根目录中的“revision”参数非常重要(例如,如果当前为 97,则下次运行时应为 98)。
特别感谢 Tinxuanna 指导我找到这个解决方案!
In order to change\update any parameter on the build definition, first run a GET request.
The result JSON output should be used as the body for the PUT request.
Use this body and change\update the relevant parameter(s) you need...
It is very important to increase the "revision" parameter, located in the root of the JSON output, in 1. (for example, if current is 97, for next run it should be 98).
Special thanks to Tinxuanna for directing me to this solution!
@ShaiO 请查看此链接 列出 Azure DevOps 管道。它可能会帮助您,因为它获取管道列表。
然后您可以按照文档创建管道。
@ShaiO Please take a look at this link List pipelines Azure DevOps. It may help you because it gets a list of the pipelines.
Then you can create a pipeline following the documentation.