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

Unable to use build step with boolean parameterized parameter

      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
      

            abayer Andrew Bayer
            herau aurelien leboulanger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: