Search code examples
azure-devopsrelease

Can you customise the build version dropdown for a VSTS Release Defintion


When you are using the online Visual Studio Team Services for the build/release process, I find the window/wizard for creating a new release to be a bit limiting. At the moment for me, when I want to pick which version of an artifact(s) I want to release it only lists the build version number, which is a pain when you have multiple artifacts built from different branches and don't necessarily always want the latest build of each.

enter image description here

Is it possible to customise this build version dropdown to include something else (like the branch it was built from)? I've tried changing the output artifact name in the build definition, thinking maybe that would be picked up in the release wizard, but it isn't.


Solution

  • Change the build name output format on the Options tab of the build definition. The variable you're looking for here is $(SourceBranchName).

    As an example:

    $(Date:yyyyMMdd)$(Rev:.r)-$(SourceBranchName)