2

I want to fill branchFilter automatically on Jenkins using JobDSL plugin and language.

This is the url of Jenkins Job DSL plugin:

https://jenkinsci.github.io/job-dsl-plugin/#path/javaposse.jobdsl.dsl.jobs.FreeStyleJob.parameters-gitParam

I want to select all branches but master. To do that I have written the following lines:

  //This Build is parametrized
  parameters {
      gitParam('branch') { // https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.BuildParametersContext.gitParam
          description('Git Branch')
          type('BRANCH')
          branchFilter("^(?!.*master).*$")
      }
  }

But when compiling it I get error that such method is not available.

Processing provided DSL script ERROR: (script, line 28) No signature of method: javaposse.jobdsl.dsl.helpers.GitParamContext.branchFilter() is applicable for argument types: (java.lang.String) values: [*] Possible solutions: tagFilter(java.lang.String)

enter image description here

Is there any workaround to do this automatically on the script or we have to fulfill that field after job has been created?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.