Integrate Deployment status to Work Items in TFS

60 Views Asked by At

I am new to Azure DevOps and I am trying to link the deployment status of my releases to the work items. I have tried going to classic release pipelines -> options -> integrations -> Report Deployment status to boards and have mapped the environments.

enter image description here

But I want to link these deployments only when the deployment is done through a specific branch like the Master and not from all the branches. I don't see any option in pipelines to select a specific branch.

Currently the deployment status of all branches are being displayed in the deployment section of workItems, which is making it hard to follow the deployments we care about. enter image description here

I have tried looking into the documentation but I couldn't find anything that helps. I am sure there must be some way to achieve this.

Any help is appreciated.

3

There are 3 best solutions below

1
Shamrai Aleksander On

Release pipelines check associated with builds work items and assign them to corresponding Boards status. To work only with the master branch, you may add CI triggers and branch filter:

enter image description here

In this case, builds started from the master branch will raise a new release after completion. The release will associate build work items from the master.

0
VishwajeetMCA On

You can think of using Azure DevOps REST API for this purpose. You can create one PowerShell or Python Script to use Azure DevOps REST API to get the deployment status and then link it to the work item.

0
Ziyang Liu-MSFT On

Currently, Azure DevOps doesn't support source branch filter when enabling "Report deployment status to Boards" in classic release pipeline. If you want such feature, you can submit a feature request here.

As a workaround, it's suggested that you create a copy of the current release pipeline. For the release pipeline triggered by main branch, as suggested by Shamrai Aleksander, enable "Report deployment status to Boards". For release pipeline triggered by other branches (CD or manually), disable "Report deployment status to Boards".