title: Jenkins pipeline user input - if Abort then action
body: <p>We have Groovy script for Jenkins with "Verify" (configrmation) step:</p>
  
  <pre><code>...
  def deploy_prod_verify() {
  
      stage 'Verify'
      input id: 'Deploy', message: 'Is Blue node fine? Proceed with Green node deployment?', ok: 'Deploy!'
  
  }
  ...
  </code></pre>
  
  <p>My question is - everything works fine (i.e. - if press "Deploy!" - next stage started). </p>
  
  <p>But - how can I run another function with Jenkins, if "Abort" was pressed? </p>
  
  <p>Now - Jenkins just will abort the current job. I'd like to run another function ("rollback") instead.</p>
  
  <p>I found some documentation <a href="https://jenkins.io/doc/pipeline/steps/pipeline-input-step/" rel="nofollow noreferrer">here</a>, but can't see anything related to "Abort" actions.</p>
  
  <p>I see that "Abort" will execute Ajax call:</p>
  
  <pre><code>&lt;a href="#" onclick="new Ajax.Request('http://&lt;JENKINS HOST&gt;/job/EU-api-staging-build/72/input/Deploy/abort'); return false"&gt;Abort&lt;/a&gt;
  </code></pre>
  
  <p>And as I understood - there is no way to handle this <code>Deploy/abort</code> anyhow.</p>