Search code examples
azure-devopsazure-pipelinesazure-pipelines-yaml

How to link work items for a yaml pipeline build when using release branches?


In Azure DevOps, when using release (flow) branches along with YAML Build(+Release) pipelines. I'd like to be able to quickly identify a list of all the work items that are new/changed since the previous release.

The Automatically link work items to builds or releases feature seems to work well with Pull Requests (PR's) into the main branch. But if the releases are done by creating branches (e.g. releases\v1.0) from latest main branch commit, this "automatic linking" doesn't appear to be an option, as you have to explicitly select a branch (the only wildcard in the list is * - can't seem to enter/select releases\*.

I think my ideal would be if there's a way that, when creating a release branch (e.g. releases\v1.2) & subsequent yaml build pipeline is triggered, it's "Related Work Items" are limited to just the ones related to commits since the last release (e.g. since releases\v1.1).

Previously, we were doing PR's from main into a single release branch - which isn't really ideal as, for one, it creates a new merge commit (plus it feels like a hack)

Thanks in advance.


Solution

  • I think my ideal would be if there's a way that, when creating a release branch (e.g. releases\v1.2) & subsequent yaml build pipeline is triggered, it's "Related Work Items" are limited to just the ones related to commits since the last release (e.g. since releases\v1.1).

    If you create releases/v1.2 bases on releases/v1.1, and specify releases/v1.1 in the settings. sample like below:

    enter image description here

    Run pipeline based on releases/v1.2 for the first run, It will include the work items from releases/v1.1.

    enter image description here

    But if the releases/v1.2 is created from main branch, even you specify releases/v1.1 in the setting, the work items will not be included.

    Please check the doc for the automatically linking work items to builds behavior.

    enter image description here