简体   繁体   English

有没有办法通过 API 跟踪 Azure DevOps 中触发的构建?

[英]Is there a way via API to track triggered builds in Azure DevOps?

With the classic build pipelines and classic triggers, it was easy enough to track builds that were triggered by completion of other builds by just polling for builds requested by the same user.使用经典构建管道和经典触发器,只需轮询同一用户请求的构建,就可以很容易地跟踪由其他构建完成触发的构建。

Now, with resource triggers, the requested by property switching to the build service account instead of the original author of the triggering commit.现在,有了资源触发器,请求的属性切换到构建服务帐户而不是触发提交的原始作者。

I have been going through the documentation to try and find another way to see triggered builds from the original build ID but have not found anything.我一直在浏览文档,试图找到另一种方法来从原始构建 ID 查看触发的构建,但没有找到任何东西。

There is an "Associated Pipelines" tab on the build summary page that at least has the pipelines containing the triggered builds, but I cannot find anything to get that by API either.构建摘要页面上有一个“关联的管道”选项卡,它至少包含包含触发构建的管道,但我也找不到任何东西可以在 API 之前获得它。

According to your description, you can first call the REST API to get all the running build pipelines in the definition, and then use the powershell script to loop check the id in the parameter triggeredByBuild in the request body in the specific build so that you can see triggered builds from the original buildId.根据你的描述,你可以先调用REST API获取定义中所有正在运行的构建管道,然后在具体构建中使用 powershell 脚本循环检查请求体中的参数triggeredByBuild中的id ,这样你就可以查看来自原始 buildId 的触发构建。

Note: The id marked in the attachment is the original buildId that triggered another build pipeline.注意:附件中标注的id是触发另一个build pipeline的原始buildId。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM