Get credentials in pipeline script
<p>I'm using "Parameterized Build" and in particular "Credentials parameter"
<a href="https://i.stack.imgur.com/EbOqu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EbOqu.png" alt="enter image description here"></a> </p>

<p>In my Pipeline script how can I access to the username and password of TEST variable?</p>

<pre><code>timeout(time: 5, unit: 'MINUTES') { 
  node('jenkins-slave1') {
      ....
      sh 'echo ${TEST_USER}'
      sh 'echo ${TEST_PASSWORD}'
  }
}
</code></pre>

<p><br>
<br></p>

<p>I know that I can use inside the script </p>

<pre><code>  withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '5994c63b-ee86-4ef1-b28a-ee2236662226', 
           passwordVariable: 'TEST_PASSWORD', 
           usernameVariable: 'TEST_USER']]) {
             sh "echo ${env.TEST_USER}"
             sh "echo ${env.TEST_PASSWORD}"
  }
</code></pre>

<p>but I need to provide this choice to the final user running the job</p>

<p>Thanks!
Riccardo</p>