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

Unable to detect PullRequest anymore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins v2.23, Bitbucket branch source plugin v1.8

      This is a regression from v1.7. In v1.7 I could test whether PR is being built with 'env.BRANCH_NAME.startsWith("PR-")', and in v1.8 'env.BRANCH_NAME' is set to name of branch from which pull request originates. This is OK for me, but the I would expect 'env. CHANGE_ID' to be set to non-null and contain information about pull request number. However, in v1.8 CHANGE_ID is null even for pull requests, while BRANCH_NAME contains name of branch for both pull requests and branches.

      How to detect from script whether PR or branch is being built? I want different build behaviour for PRs and feature branches.

            nfalco Nikolas Falco
            dodoent Nenad Miksa
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: