Accessing variables in VSTS for release name format

1k views Asked by At

I have a group variable defined globally in a VSTS project, I can access its value from a powershell script as a task inside a release task, but if I try to use it as a variable for the release name format (in general tab) it threats the variable as string so it does not display its value but its name as part of the release name.

$(gReleaseName)_$(rev:_r)

Any clue about how to access the variable value?

1

There are 1 answers

0
OutKa5t On

Your syntax is almost correct. Check that your variable is named 'gReleaseName'.

You also can't use an underscore on the revision increment, you need to use a colon e.g. $rev:r

So assuming your variable is named correctly then use $(gReleaseName)_$(rev:r) for the release name format on the general tab.

Here is an example using a global variable called 'GlobalVar' where the value is sett to 'BOSS'

enter image description here