Unable to use build step with boolean parameterized parameter

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

XMLWordPrintable

      I'm not able to use both parameters and build with boolean parameter because the build step need a boolean value and i can only pass the value with a string:

      #!/usr/bin/env groovy
      pipeline {
          agent any
      
          parameters {
              booleanParam(defaultValue: false, description: 'Simulate the promotion', name: 'SIMUL')
          }
      
          stages {
              stage('promote') {
                  steps {
                      build job: 'promote', parameters: [
                          booleanParam(name: 'SIMUL', value: "${env.SIMUL}")
                      ]
                  }
              }
          }
      }
      

      will generate this kind of error:

      java.lang.ClassCastException: hudson.model.BooleanParameterValue.value expects boolean but received class java.lang.String
      

            Assignee:
            Andrew Bayer
            Reporter:
            aurelien leboulanger
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: