I want to fill branchFilter automatically on Jenkins using JobDSL plugin and language.
This is the url of Jenkins Job DSL plugin:
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)
Is there any workaround to do this automatically on the script or we have to fulfill that field after job has been created?