title: Conditional input step in declarative pipeline
body: <p>using Jenkins <code>v2.138.2</code> and workflow-aggregator <code>v2.6</code>, I'm trying to define a conditional <code>input</code> step that depends on the value of a job parameter as follows:</p>
  
  <pre><code>stage('apply') {
  
    when { expression { params.apply_plan != 'no' } }
  
    if (params.apply_plan != 'yes') {
      input {
        message 'Apply this plan?'
      }
    }
  
    steps {
      withAWS(region: 'us-east-1', role: assume_role) {
        dir(path: tf_dir) {
          sh "make apply"
        }
      }
    }
  }
  </code></pre>
  
  <p>However this <code>if { ( ... ) input { ...} }</code> syntax gives me a run-time error:</p>
  
  <blockquote>
    <p>java.lang.ClassCastException: org.jenkinsci.plugins.workflow.support.steps.input.InputStep.message expects class java.lang.String but received class org.jenkinsci.plugins.workflow.cps.CpsClosure2</p>
  </blockquote>
  
  <p>Any idea how to do this?</p>
  
  <p>Thanks,
  Chris</p>