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

NullPointerException in Declarative Jenkinsfile Pipeline Syntax Validator (when clause)

    XMLWordPrintable

    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

            nroth Nicholas Roth created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Component/s declarative-pipeline-when-conditions-plugin [ 23168 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #209 (Web Link)" [ 17926 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              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: