使用REST API获取Azure ADO中管道的所有状态
我正在尝试使用REST API在Azure ADO中获取管道状态。
但是仅给出最后完成的工作的状态。
我希望获得管道所有运行的状态。您能否指导我并帮助相关的API。
I am trying to fetch the status of pipeline in Azure ADO using rest API.
I tried using GET status API using https://learn.microsoft.com/en-us/rest/api/azure/devops/build/status/get?view=azure-devops-rest-6.0
But it gives only the status of the last completed job.
I am looking to fetch status of all the runs of the pipeline. Could you please guide me and help with the relevant API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
获得状态API仅显示此管道的最新运行状态。
作为解决的工作,您可以使用获取运行列表API: https://learn.microsoft.com/en-us/rest/rest/rest/api/azure/devops/devops/pipelines/runs/runs/list?view = azure-devops-rest-rest-6.0
get https://dev.azure.com/ {agromply}/{project}/_apis/pipelines/{pipelineId}/runs?api-version = 6.0-preview.1
检查响应主体的结果值。
Get status API only shows the latest run status of this pipeline.
As a work around, you could use Get Runs List API: https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/list?view=azure-devops-rest-6.0
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1
And check the result value from the response body.