0

How can I configure my Jenkins Pipeline project to provide the CHANGE_* variables related to a Bitbucket Server commit? The project's Pipeline definition is Pipeline script from SCM (Bitbucket Server Integration).

I have checked Bitbucket Server trigger build after push made available from the Bitbucket Server Integration Jenkins plugin and the build does get triggered, but the variables related to the commit/change message, author, author email, etc. are all missing.

pipeline {
    agent any
    stages {
        stage("Hello variables") {
            steps {
                sh 'printenv'
            }
        }
    }
}

The only Bitbucket related env variables are GIT_BRANCH, GIT_COMMIT, and GIT_URL.

Johnathan Elmore
  • 2,156
  • 1
  • 19
  • 25

1 Answers1

1

The Bitbucket webhook (trigger) plugin does not provide a json payload.

If you want to get Bitbucket trigger json payload (and query it inside the the pipeline) you'll need to use the Generic Webhook Trigger

Boris
  • 198
  • 7
  • Updated my question to include that we are using the Bitbucket Server Integration plugin. https://plugins.jenkins.io/atlassian-bitbucket-server-integration/ – Johnathan Elmore May 05 '21 at 23:38
  • I recommend using the Generic Webhook Trigger for triggering the pipeline. You can still use the Bitbucket Server Integration plugin for everything else. – Boris May 09 '21 at 05:49