title: Get Jenkins build failure cause in groovy script
body: <p>I am Jenkins beginner.
  I want to inject 'reason behind build failure' as an environment variable through groovy script.
  How to get build failure cause in groovy script ?</p>