title: Jenkins: import external package from Jenkinsfile using declarative syntax
body: <p>I had a groovy code wich contains "import groovy.json.JsonSlurper". </p>
  
  <p>I have spent a day testing and i dont know how to load external libraries using declarative syntax.</p>
  
  <p>This is my code:</p>
  
  <pre><code>pipeline {
  
  agent any
  
  import groovy.json.JsonSlurper
  
          stages {
  
                  stage("test") {
  
                          steps {
                           }
                  }
          }
  }
  </code></pre>
  
  <p>I have read the jenkins documentation, and i have tried to use the next but without success:</p>
  
  <p>@Grab('groovy.json.JsonSlurper')
  import groovy.json.JsonSlurper</p>
  
  <p>both import and @Grab is not recognized. Some idea?</p>
  
  <p>Thanks!</p>