Reputation: 161
I want to build job with build parameters in Jenkins pipeline.
Unfortunately job is unable to list the branches it is throwing java exception error.
Git parameter plugin configuration
Error on Triggering of job. Error in Build
Upvotes: 1
Views: 6383
Reputation: 161
Below steps worked for me.
1) Add git parameter Add git parameter
2) Call the variable in script and in configuration
Pass same variable name as defined earlier in branch section
Upvotes: 0
Reputation: 21
You can install Parameterized Build In your Jenkins job configuration tick/select This project is parameterized > Add Parameter > String Parameter
Then in Jenkinsfile I believe you should be able to reference your parameter eg.
branches: [[name: '*/' + PARAMETER_NAME ]],
Upvotes: 1