When using the GitHub Organization Folder, none of the builds have the CHANGE_* variables set.

      I have tried both sh 'env | sort' and echo "${env.CHANGE_ID}".

      I'm expecting these to be set:

      • CHANGE_ID
      • CHANGE_URL
      • CHANGE_TITLE
      • CHANGE_AUTHOR
      • CHANGE_AUTHOR_DISPLAY_NAME
      • CHANGE_AUTHOR_EMAIL
      • CHANGE_TARGET

          [JENKINS-39838] CHANGE_ variables are missing

          Could you please also add following variables:
          Source_branch
          Repository_owner (organization)
          repository_name
          sha (commit_sha)
          the last one is very important

          Viachaslau Kabak added a comment - Could you please also add following variables: Source_branch Repository_owner (organization) repository_name sha (commit_sha) the last one is very important

          Aidan Steele added a comment -

          maniax89 I was struggling with this as well and found that changing the configuration from Build origin branches also filed as PRs (default checked) to Build origin PRs (merged with base branch) was enough to get the env vars set in my jobs.

          Aidan Steele added a comment - maniax89 I was struggling with this as well and found that changing the configuration from Build origin branches also filed as PRs (default checked) to Build origin PRs (merged with base branch) was enough to get the env vars set in my jobs.

          Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)... Closing this issue in any case as with the 2.0 series of GitHub Branch Source the GitHub Organization Folders plugin is dead (functionality moved to GitHub Branch Source)

          Stephen Connolly added a comment - Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)... Closing this issue in any case as with the 2.0 series of GitHub Branch Source the GitHub Organization Folders plugin is dead (functionality moved to GitHub Branch Source)

          Like Guitar added a comment -

          I got same problems when sending 

          ${CHANGE_TITLE} ${CHANGE_AUTHOR} ${CHANGE_TARGET} ${CHANGE_AUTHOR_DISPLAY_NAME}
          

          with Chatwork Plugin

          I also tried this way too

          $CHANGE_TITLE $CHANGE_AUTHOR $CHANGE_TARGET $CHANGE_AUTHOR_DISPLAY_NAME
          

           

          Like Guitar added a comment - I got same problems when sending  ${CHANGE_TITLE} ${CHANGE_AUTHOR} ${CHANGE_TARGET} ${CHANGE_AUTHOR_DISPLAY_NAME} with Chatwork Plugin I also tried this way too $CHANGE_TITLE $CHANGE_AUTHOR $CHANGE_TARGET $CHANGE_AUTHOR_DISPLAY_NAME  

          > Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)

          No. It's more than that. I think something is wacky here.  It may just be the case that GitHub items should have different variables (e.g. PR_ vars) or something.

          My users (about 200 developers) are constantly tripping on this.  Some of the variables seem to imply they should always be set, instead of just for a PR.  e.g. If I push a new commit, shouldn't there be a record of the changes that triggered it?  Regardless of whether you are doing a "merged with base" or not.

          Christian Höltje added a comment - > Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue) No. It's more than that. I think something is wacky here.  It may just be the case that GitHub items should have different variables (e.g. PR_ vars) or something. My users (about 200 developers) are constantly tripping on this.  Some of the variables seem to imply they should always be set, instead of just for a PR.  e.g. If I push a new commit, shouldn't there be a record of the changes that triggered it?  Regardless of whether you are doing a "merged with base" or not.

          Andrew Piatek added a comment - - edited

          Same comment as Christian. Can this be resolved? We are not using the dead plugin but rather Blue Ocean with GitHub Branch Source plugin.

          Andrew Piatek added a comment - - edited Same comment as Christian. Can this be resolved? We are not using the dead plugin but rather Blue Ocean with GitHub Branch Source plugin.

          Amir Barkal added a comment - - edited

          When configuring a multibranch pipeline repository to detect Pull Requests from GitHub, I get  the following CHANGE_* env variables populated properly:

          CHANGE_AUTHOR
          CHANGE_AUTHOR_DISPLAY_NAME
          CHANGE_BRANCH
          CHANGE_ID
          CHANGE_TARGET
          CHANGE_TITLE
          CHANGE_URL

           

          The CHANGE_AUTHOR_EMAIL var is critically missing from this list, which is paramount to alert users about regressions in their pull requests.

           

          Environment:

          Jenkins ver. 2.128 

          GitHub Branch Source Plugin 2.3.6 (latest)

          Pipeline: Multibranch 2.19 (latest)

          Amir Barkal added a comment - - edited When configuring a multibranch pipeline repository to detect Pull Requests from GitHub, I get  the following CHANGE_* env variables populated properly: CHANGE_AUTHOR CHANGE_AUTHOR_DISPLAY_NAME CHANGE_BRANCH CHANGE_ID CHANGE_TARGET CHANGE_TITLE CHANGE_URL   The  CHANGE_AUTHOR_EMAIL var is critically missing from this list, which is paramount to alert users about regressions in their pull requests.   Environment: Jenkins ver. 2.128  GitHub Branch Source Plugin 2.3.6 (latest) Pipeline: Multibranch 2.19 (latest)

          Barathwaja S added a comment - - edited

          Is there any progress on this? Need some of the above env. variables to be used in a project. Any ETA on this?

           

          Ref. JENKINS-40486

          Barathwaja S added a comment - - edited Is there any progress on this? Need some of the above env. variables to be used in a project. Any ETA on this?   Ref.  JENKINS-40486

          Allin Cortez added a comment -

          It has been a while since any action on this page, mostly likely because it is a closed issue, but I am seeing the same problem as Amir Barkal was seeing above above. The listed CHANGE_* vars are set, but not CHANGE_AUTHOR_EMAIL.

          Environment:

          Using a multibranch job with the Branch Sources plugin using a github app for authentication.

          Jenkins 2.235.1
          GitHub API Plugin 1.114.3
          GitHub Branch Source Plugin 2.8.2
          GitHub plugin 1.30.0

          I am happy to open a separate ticket for this issue if someone suggests that.  My main reason for commenting here is to let others know that I am also seeing this problem, as it seems like if it is a valid problem, then it ought to affect many people.

          FWIW for now, I am planning on working around the issue by simply examining the email address belonging to the author of the most recent git revision on the PR branch.  However don't be mislead... I don't believe this solution is equivalent to what we should expect from CHANGE_AUTHOR_EMAIL, as I believe that email address ought to be whatever email address the PR author has set up in Github, which is not necessarily the same as the author of the most recent commit on the PR branch.

          I will also note that I am migrating from Bitbucket to Github, and the Bitbucket plugin does provide CHANGE_AUTHOR_EMAIL, so we should aim for feature parity here also.

           

          Allin Cortez added a comment - It has been a while since any action on this page, mostly likely because it is a closed issue, but I am seeing the same problem as Amir Barkal was seeing above above. The listed CHANGE_* vars are set, but not CHANGE_AUTHOR_EMAIL. Environment: Using a multibranch job with the Branch Sources plugin using a github app for authentication. Jenkins 2.235.1 GitHub API Plugin 1.114.3 GitHub Branch Source Plugin 2.8.2 GitHub plugin 1.30.0 I am happy to open a separate ticket for this issue if someone suggests that.  My main reason for commenting here is to let others know that I am also seeing this problem, as it seems like if it is a valid problem, then it ought to affect many people. FWIW for now, I am planning on working around the issue by simply examining the email address belonging to the author of the most recent git revision on the PR branch.  However don't be mislead... I don't believe this solution is equivalent to what we should expect from CHANGE_AUTHOR_EMAIL, as I believe that email address ought to be whatever email address the PR author has set up in Github, which is not necessarily the same as the author of the most recent commit on the PR branch. I will also note that I am migrating from Bitbucket to Github, and the Bitbucket plugin does provide CHANGE_AUTHOR_EMAIL, so we should aim for feature parity here also.  

          Eugene G added a comment -

          Same issue. env.CHANGE_AUTHOR does exist but env.CHANGE_AUTHOR_EMAIL is empty.

          Jenkins ver. 2.204.2
          GitHub plugin 1.29.4
          GitHub API 1.110
          GitHub Branch Source 2.6.0
          GitHub Organization Folder Plugin 1.6

          Eugene G added a comment - Same issue. env.CHANGE_AUTHOR does exist but env.CHANGE_AUTHOR_EMAIL is empty. Jenkins ver. 2.204.2 GitHub plugin 1.29.4 GitHub API 1.110 GitHub Branch Source 2.6.0 GitHub Organization Folder Plugin 1.6

            kohsuke Kohsuke Kawaguchi
            docwhat Christian Höltje
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: