-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
jenkins: 1.625.3
groovy-postbuild: 1.8
Summary
When jenkins runs a parameterized job, if one of the string parameters has a value of 0 and the groovy postbuild task attempts to read that parameter, it will show up as null.
To Reproduce
- Create a Jenkins Job
- 'This Build is parameterized'
- Add one string parameter (eg: name some-param) with default value 0
- Add a post-build action for groovy postbuild
- Add the following code:
```
def varName = "some-param";
def tempVal = manager.build.buildVariables.get(varName )
if(tempVal == null || tempVal.equals("")){
manager.listener.logger.println("${varName} not found: '${tempVal}'")
}
``` - Run the parameterized build, leaving the default value
- View the console and note the log output of the empty param