1
votes

I am trying to specify "Build pipeline" value in download build artifacts task as variable value like "$(Pipeline)".

But the classic editor does not allow to do so.

adding build pipeline as variable

Is there anyway to achieve this?

2

2 Answers

1
votes

Look like you can't use a variable in this input when you use the Classic Editor, but you can use a variable if you use a YAML pipeline:

variables: 
  buildName: TestBuild

steps:
  - task: DownloadBuildArtifacts@0
    inputs:
      buildType: 'specific'
      project: 'xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx'
      pipeline: '$(buildName)'
      buildVersionToDownload: 'latest'
      downloadType: 'single'
      downloadPath: '$(System.ArtifactsDirectory)'
      artifactName: test

If you still want to use the Classic Editor you can "hack" the system by export the build to json:

enter image description here

Open the json and replace there the value with a variable, then import the build:

enter image description here

Results:

enter image description here

0
votes

Can we see a more complete screenshot of what you're trying to accomplish? There are two tasks for this, "Download Build Artifacts" and "Download Pipeline Artifact", and neither is giving me any trouble with a variable reference:

Download Build Artifacts

Download Pipeline Artifact