jenkinsci / bitbucket-push-and-pull-request-plugin

Plugin for Jenkins v2.138.2 or later, that triggers job builds on Bitbucket's push and pull request events.
https://plugins.jenkins.io/bitbucket-push-and-pull-request
MIT License
46 stars 50 forks source link

Unable to get plugin working on multibranch pipelines and Bitbucket server #247

Open curtisgcarroll opened 2 years ago

curtisgcarroll commented 2 years ago

Versions: Jenkins - 2.289.1 Bitbucket Server - 7.17.4 Bitbucket PPR Plugin - 2.7.2 Pipeline Multibranch - 2.24

I have a job setup using a .pipelinejob file as below. Triggers do not seem to make it down to the children jobs that are spawned when branches are created in this test repo. When I push to the remote, the logs show jobs being checked for matching triggers but when the multibranch pipeline is checked I just receive "Bitbucket Trigger for job: CURTIS » MULTI » test is not present."

Are there examples of multibranch pipelines to look at? Is there additional configuration that may have been missed in the readme? I could not see any specific callouts in the documentation, but I did see the note that BB server support for multibranch was added in 2.6.1

import jenkins.model.Jenkins

multibranchPipelineJob("/CURTIS/MULTI") {
    def repo = 'testsite/curtis.git'

     branchSources{
        git {
            id('curtistesting')
            remote('testsite/curtis.git')
            credentialsId('bitbucket')
            includes('*')
        }
    }

    triggers {
        bitBucketTrigger{
            triggers{
                bitBucketPPRRepositoryTriggerFilter {
                    actionFilter{
                        bitBucketPPRServerRepositoryPushActionFilter {
                            triggerAlsoIfTagPush(false)
                            triggerAlsoIfNothingChanged(true)
                            allowedBranches("*")
                        }
                    }
                }
            }
        }
    }

    description("Pipeline for $repo")

    factory{
        workflowBranchProjectFactory {
            scriptPath('scripts/pipelines/MultiPR/multiPR.jenkinsfile')
        }
    }
}
JoaoPPCastelo commented 2 years ago

Facing same issue with a typical Jenkinsfile. Seem's that properties defined on file are not taken into consideration. The same configs but set on the UI are applied and everything works