-
Bug
-
Resolution: Unresolved
-
Minor
-
None
As of... Jenkins 2.235.4
To reproduce
- Create a jenkinsfile on SCM
- Give it a parameter of any type (for example, a string named "greeting")
- Give it some default value of "Hello World"
- Add a step to echo the value of "greeting"
- Add a new jenkins job: type=pipeline
- Choose "pipeline script from scm"
- Point to the Jenkinsfile you added in step 1
- Click "build" button
- Of note, "Build with parameters isn't an option because Jenkins doesn't know that the job has a parameter when it's added this way". I believe this is the root of the issue.
So, the first run of the job should print "null" rather than "Hello World" because using the "build" button seems to set all the parameters to "null" instead of using their default values.
After the first run, the job will have a "Build with parameters" button, so the issue will never occur again.
I'm not sure what a sensible approach is to resolving this issue, but i brought it up in IRC and several people said they had been dealing with the same bug historically and just accepted it.