0

We have a requirement from our client that they need a criteria to be met firstly before being able to be merged to ‘main’. Its okay to go in ‘develop’ but when it should go to ‘main’ want to have some sort of TAG, check box, a field or something similar to that on the PBI/BUG which ‘blocks’ the deployment to ‘main’ unless ticked/approved/removed.

Repository: Azure DevOps, Git Pull request will be from Develop to main branch.

I checked in blogs, but i couldn't find any proper option for this. Please let me know if we have any options for this.

torek
  • 448,244
  • 59
  • 642
  • 775
Mano
  • 1

1 Answers1

0

As an out-of-box solution, no. But you can add a build step (or a separate validation build pipeline) that performs the following through the rest api:

  1. Get work items ids of a pull request: Pull Request Work Items - List
  2. Get work items details: Work Items - Get Work Item

Check the example: Get Workitems from VSTS

Additionally, you can use Azure CLI:

  1. az repos pr work-item list
  2. az boards work-item show

Use this variable to get an active pull request id in your build: System.PullRequest.PullRequestId

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31