Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58751

TAG_NAME is not populated in declarative multibranch pipeline

      I configured a multibranch pipeline to check out via git, discover branches, discover tags and the added clone behaviour to fetch tags.

      However I can't use the when condition with tags as outlined here (https://jenkins.io/blog/2018/05/16/pipelines-with-git-tags/). According to the docs (https://jenkins.io/doc/book/pipeline/syntax/#when) when depends on the variable TAG_NAME which I assume should be set by Jenkins. But both  params.TAG_NAME, env.TAG_NAME are null.

      Thus my when condition 'when { tag "" }' never triggers.

          [JENKINS-58751] TAG_NAME is not populated in declarative multibranch pipeline

          John Doe created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Summary Original: TAG_NAME is not populated in descriptive multibranch pipeline New: TAG_NAME is not populated in declarative multibranch pipeline
          John Doe made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          John Doe made changes -
          Component/s New: declarative-pipeline-when-conditions-plugin [ 23168 ]
          Component/s Original: git-plugin [ 15543 ]
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          Mark Waite made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Closed [ 6 ]

            Unassigned Unassigned
            jenkinsuser12345678 John Doe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: