-
Bug
-
Resolution: Unresolved
-
Minor
-
Jenkins Docker 2.235.3-jdk11
For plugins and versions see attached text file.
When configuring a multibranch pipeline job via job DSL, I was unable to successfully have it populate the "Bitbucket Server instance" field. I set the serverId in the job DSL to the same value in the "Instance name" from the Jenkins configuration settings, but it would not work. I then attempted the "Instance URL" and that did not work either. I finally got creative, and I dug around in the Jenkins home. Inside com.atlassian.bitbucket.jenkins.internal.config.BitbucketPluginConfiguration.xml I found an ID field, which looks like some sort of GUID (big long string of letters, numbers, and dashes). When I put that into the serverId field in the job DSL, it worked! So I have a work around, but I highly doubt the plugin is supposed to behave that way as it should likely take the "Instance name" value instead which is the value you select in the UI when configuring the multibranch pipeline job.
Example Job DSL
multibranchPipelineJob('TestGroup/test-multi') { displayName('test-multi') branchSources { branchSource { source { BbS { id("test-multi") credentialsId("bitbucket-scan") serverId("42181cb2-1735-49ac-88b3-6e9f018c72ff") mirrorName("Primary") projectName("TestGroup") repositoryName("test-multi") traits { gitBranchDiscovery() headWildcardFilter { includes('*') excludes('master') } } } } } } triggers { BitbucketWebhookMultibranchTriggerImpl() } }
- is related to
-
JENKINS-64801 Support for Job DSL
- Open