Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47559

NullPointerException in Declarative Jenkinsfile Pipeline Syntax Validator (when clause)

    Details

    • Similar Issues:

      Description

      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"
            }
          }
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                nroth Nicholas Roth
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: