Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag based on Build Variable #74

Open
b-twis opened this issue Jul 29, 2020 · 0 comments
Open

Tag based on Build Variable #74

b-twis opened this issue Jul 29, 2020 · 0 comments

Comments

@b-twis
Copy link

b-twis commented Jul 29, 2020

Hello,

Is it possible to use build variables in the tags. I have tried with the following two YAMl options (I am running a multi stage YAML pipeline).

Where ENV_RELEASE is a custom variable set at runtime and BUILD_REPOSITORY_NAME is a standard one set by the pipeline.

- task: WorkItemUpdater@2
  displayName: 'Tag WorkItems'
  inputs:
    workitemsSource: 'Build'
    workItemType: 'Bug,Feature,Task,User Story'
    linkBuild: true
    updateAssignedTo: 'Never'    
    addTags: |
      ${{ parameters.environment }}
      $(BUILD_REPOSITORY_NAME)
      $(ENV_RELEASE)

Results in the following tags 'cl-uat', '$(BUILD_REPOSITORY_NAME)', '$(ENV_RELEASE)'
THe first tag is correct, but the other two are not.

The following has the same issue.

- task: WorkItemUpdater@2
  displayName: 'Tag WorkItems'
  inputs:
    workitemsSource: 'Build'
    workItemType: 'Bug,Feature,Task,User Story'
    linkBuild: true
    updateAssignedTo: 'Never'    
    addTags: |
      ${{ parameters.environment }}
      $[variables.BUILD.REPOSITORY.NAME]     

Same results as avove .Tags 'cl-uat', '$[variables.BUILD.REPOSITORY.NAME]', '$[variables.ENV_RELEASE]'

Any pointer here would be great.

Thanks,

Basil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant