parameterized job with string having default 0 breaks groovy postbuild reading property

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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

      1. Create a Jenkins Job
      2. 'This Build is parameterized'
      3. Add one string parameter (eg: name some-param) with default value 0
      4. Add a post-build action for groovy postbuild
      5. 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}'")
        }
        ```
      6. Run the parameterized build, leaving the default value
      7. View the console and note the log output of the empty param

            Assignee:
            Zach Auclair
            Reporter:
            Zach Auclair
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: