Search code examples
jenkins-pipelinebitbucket-serverjenkins-job-dsl

Unable to seed a pipeline job which has the BbS SCM step


Unable to Seed a pipeline job when replacing the git SCM step in the groovy for the scm definition with Bbs SCM step and receive the following error

Build Error: [hudson.AbortException: (job.groovy, line 50) No signature of method: javaposse.jobdsl.dsl.helpers.ScmContext.Bbs() is applicable for argument types: (<git-folder>$_run_closure1$_closure4$_closure6$_closure7$_closure8) values: [<git-folder>$_run_closure1$_closure4$_closure6$_closure7$_closure8@71df7e4c] Possible solutions: is(java.lang.Object), any(), git(groovy.lang.Closure), git(java.lang.String), hg(java.lang.String), rtc(groovy.lang.Closure)]

When editing the job using the Jenkins UI and updating the all the appropriate fields, everything works perfectly. Just that the seed-job fails to read the groovy file to create a job.

Below is my groovy code for the SCM step:

definition {
   cpsScm {
         scm {
             Bbs {
                 id('id')
                 branches {
                     branchSpec {
                         name('test')
                     }
                 }
                credentialsId('user')
                gitTool(null)
                mirrorName('')
                projectName('Proj')
                repositoryName('Repo')
                serverId('12345')
             }
         scriptPath(jenkinsfile)
        }
    }   
}

Please advice/assist on this issue.


Solution

  • The issue is resolved. Please refer the resolution here