Azure-devops-docs: Variable inside variable?

Created on 14 Jun 2018  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

I would like to get Release.TriggeringArtifact.Alias first and use its value to get the build ID, is this possible? thanks.

$(Release.Artifacts.$(Release.TriggeringArtifact.Alias).BuildId)

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cictech devopprod doc-bug product-question

All 8 comments

Thank you for your feedback. I have passed this on to the product team for advice.

Thanks, I am currently using the following Powershell as workaround:

$a = "$(Release.TriggeringArtifact.Alias)"
$x = ("RELEASE_ARTIFACTS_" + $a + "_DEFINITIONID")
Write-Host "Get Env Var $x"
$buildId = (get-item env:$x).Value
Write-Host "Build ID is $buildId"
Write-Host "##vso[task.setvariable variable=buildId]$buildId"

Hi @thomasmktong
Getting the build id the way you want is not available. You will need to write some powershell to get it, like what you have already done.

@azooinmyluggage I ran into the same issue/question, struggeled for quite some time and found help on stackoverflow https://stackoverflow.com/questions/53191250/access-sourcebranchname-in-release-pipeline and I would really appreciate if you could add the (Get-Item env:$x) example into this docu, because it is no obvious on how to get it given the examples.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Since this isn't resovled in my opinion, I'm not sure on how to reactivate it.

Marking as doc-bug for triage, see the following:

@azooinmyluggage I ran into the same issue/question, struggeled for quite some time and found help on stackoverflow https://stackoverflow.com/questions/53191250/access-sourcebranchname-in-release-pipeline and I would really appreciate if you could add the (Get-Item env:$x) example into this docu, because it is no obvious on how to get it given the examples.

Thanks for your question. It looks like your question isn't an issue with the documentation, but an issue or question specific to your implementation or a bug in the product itself.

For help with a specific task, here are a couple of options where you might consider asking your question:

If you've encountered an issue with the product itself, to make sure it gets in front of the right people, please submit your bug here.

If you have an idea for improving the product, please submit your idea here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-o00o-o picture o-o00o-o  Â·  3Comments

sandeepzgk picture sandeepzgk  Â·  3Comments

atrauzzi picture atrauzzi  Â·  3Comments

cijujoseph picture cijujoseph  Â·  3Comments

Naphier picture Naphier  Â·  3Comments