NullPointerException in Declarative Jenkinsfile Pipeline Syntax Validator (when clause)

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

XMLWordPrintable

      Jenkinsfiles like what you see below (note the lack of 'expression' block in the 'when' clause) cause a NullPointerException instead of reporting a syntax error.

      pipeline {
        agent { label 'Some Machine' }
        
        parameters {
          string(name: 'Type', defaultValue: 'Nightly', description: 'Type of build to perform -- can be "Nightly," "CI," or "PR"')
        }
      
        stages {
      
          stage('Fix Me') {
            when {
              params.Type == 'CI'
            }
      
            steps {
              echo "Hello World"
            }
          }
        }
      }
      

            Assignee:
            Andrew Bayer
            Reporter:
            Nicholas Roth
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: