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

booleanParam will give String variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.164.2

      Defining a boolean parameter will not return a boolean value as expected, but a String value.

      Defining the parameter:{{}}

      parameters { booleanParam(name: 'bForceCheckout', defaultValue: false, description: '') }

      Checking the type...

      println bForceCheckout.getClass()
      

      ...will give you:

      09:06:03 class java.lang.String
      

      This of course leads to some nice behaviour when checking the variable in conditions...

            svanoort Sam Van Oort
            chrop Christian Opitz
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: