admin管理员组文章数量:1379620
I am looking to do some work item validation on a Pull request prior to approval but i can't see an easy way to do this.
The workflow would be
A developer will create a pull request and include a development, a test and a UAT "task" as part of it.
I want to be able to easily see that the work items are
a) all the tasks listed linked b) they are all set to done c) the names of the assignees of each task are different.
I don't think this is a native option in ADO would this need to be developed and included as a approval check?
I have reviewed the settings for a pull request but it only offers options for linked items must exist not the content of the linked tasks.
Is there the option to write a powershell script that runs as part of the Pull request or an Azure Function that would allow me to do some additional validation when a pull request is triggered. Im reasonably new to Azure and Powershell so any advice would be greatly appreciated.
I am looking to do some work item validation on a Pull request prior to approval but i can't see an easy way to do this.
The workflow would be
A developer will create a pull request and include a development, a test and a UAT "task" as part of it.
I want to be able to easily see that the work items are
a) all the tasks listed linked b) they are all set to done c) the names of the assignees of each task are different.
I don't think this is a native option in ADO would this need to be developed and included as a approval check?
I have reviewed the settings for a pull request but it only offers options for linked items must exist not the content of the linked tasks.
Is there the option to write a powershell script that runs as part of the Pull request or an Azure Function that would allow me to do some additional validation when a pull request is triggered. Im reasonably new to Azure and Powershell so any advice would be greatly appreciated.
Share Improve this question edited Mar 29 at 12:47 qkfang 1,7851 gold badge1 silver badge20 bronze badges asked Mar 28 at 18:39 David RobertsonDavid Robertson 11 bronze badge1 Answer
Reset to default 0Currently, there is no build-in feature that can meet your needs. As a workaround, you can use build validation policy. When there is new PR created or new commit in source branch, the pipeline will be triggered. You can validate work items in the pipeline by writing your own scripts. In the pipeline:
Run REST API Get Pull Request to get linked work items.
GET https://dev.azure/{anization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}?includeWorkItemRefs=true&api-version=7.1
repositoryId
can be obtained from predefined variableBuild.Repository.ID
.pullRequestId
can be obtained from predefined variableSystem.PullRequest.PullRequestId
.
Run REST API Get Work Item to check the state and assignee of each work item.
Customize the script according to your actual needs by yourself.
本文标签: azureADO Pull Request Validate Work Items AutomaticallyStack Overflow
版权声明:本文标题:azure - ADO Pull Request Validate Work Items Automatically - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744018551a2576786.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论