title: groovy:: compound if statement not evaluating to true
body: <p>hi I am trying to understand issue where given <code>if (version_exists != '' &amp;&amp; env.force_build == true)</code> is evaluating to true even if env.force_build is set to false</p>
  <pre><code>pipeline {
      agent { label 'master' }
      parameters {
          string(defaultValue: 'DEV', description: '', name: 'ENV', trim: true)  
          string(defaultValue: 'sys', description: '', name: 'platform_type', trim: true)
          string(defaultValue: 'yyy', description: '', name: 'dev_app_host', trim: true)
          string(defaultValue: 'xxx.dv.local', description: '', name: 'dev_xbar_host', trim: true)
          string(defaultValue: '1.0.0.23', description: '', name: 'VERSION', trim: true)
          booleanParam(defaultValue: false, description: 'force build if possible', name: 'force_build')
      }
      environment {
          git_credential_id = '1234'
          app_name = 'application'
          app_module_name = 'dvmt_event_processor'
          app_git_url = 'ssh://git@oooo:7999/data/application.git'
          dna_common_git_url = 'ssh://git@oooo:7999/data/dna-common.git'
          ansible_git_url = 'ssh://git@oooo:7999/data/operations-ansible.git'
          pip_port = '9700'
      }
      
      stages {
          stage('checkout from SCM') {
              .....
          }
          stage('build') {
                  steps {
                      script {
                          // version_exists == dvmt_event_processor-1.0.0.23-py2.py3-none-any.whl
                          // force_build == false
  
                          def version_exists = ''
                          version_exists = sh(script: &quot;ssh -o StrictHostKeyChecking=no ansible@pypi server ls /var/pypi/packages/dev/ | grep ${env.app_module_name}  | grep ${env.VERSION}&quot; , returnStdout: true)
  
  
                          if (version_exists != '' &amp;&amp; env.force_build == true) {
                                  ......
                                  // evaluating to true no matter what
                              }
                          }
                          else if (version_exists != '' &amp;&amp; env.force_build == false ) {
                              echo &quot;version already exists, just deploying&quot;
                              ......
  
  
                          }
                          else {
                                  echo &quot;starting full build&quot;
                                  .........
                          }
                      }
                  }
              }
          stage('Test') {
              steps {
                  echo 'Testing...'
                  .............
              }
          }
      }
  }
  </code></pre>
  <p>jenkins console o/p</p>
  <pre><code>dvmt_event_processor-1.0.0.23-py2.py3-none-any.whl
  
  [Pipeline] echo
  false
  [Pipeline] echo
  starting full build
  </code></pre>