Pass parameters in jenkins pipeline to internal groovy script
<p>How can we pass parameters in Groovy script in Jenkins pipeline?</p>

<p>I have written xyz.groovy, it loads and executes fine but i would like to pass parameters in it instead of duplication of jobs. I tried passing load '../xyz.groovy' param1 param2 but no luck.</p>

<h1>Pipeline script:</h1>

<pre><code>node {
    load '../xyz.groovy'
}()
</code></pre>

<h1>xyz.groovy</h1>

<pre><code>import hudson.model.*
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
import java.net.URL

echo "\nParameters.."
echo param1
echo param2
</code></pre>