Get the list of skipped tasks on Azure DevOps Pipeline

北城以北 提交于 2021-02-11 15:49:06

问题


Is there a way by which we can get the list of skipped tasks from the build?

For example, I have 2 tasks that run conditionally only based on external factors. So how can I see, whether the tasks were skipped or actually ran from Azure DevOps REST API?

I need to trigger another build conditionally based on the above factor.

Any help will be appreciated!


回答1:


You should look into the Build Timeline REST API. If you issue the following GET request:

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/timeline

where buildId is the ID of the build you're examining, it returns the Timeline object. It is essentially a collection of TimelineRecord objects, each representing an entry in a build's timeline. You should filter out this collection to leave only those, where "type": "Task" and "result": "skipped".



来源:https://stackoverflow.com/questions/58706951/get-the-list-of-skipped-tasks-on-azure-devops-pipeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!