title: Jenkins: How to access parameters in a parameterized job
body: <p>I have a parameterized build like below:</p>
  
  <p><a href="https://i.stack.imgur.com/Sy0W6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sy0W6.png" alt="enter image description here"></a></p>
  
  <p>then i've create a groovy script to create a variable URL_TOMCAT where its value depends on the TARGET_TOMCAT parameter:</p>
  
  <p>Even after this <strong>update</strong> i got the same error </p>
  
  <pre><code>import hudson.model.*
  def target = build.buildVariableResolver.resolve("TARGET_TOMCAT")
  def URL_TOMCAT = ""
  switch(target ) {
    case "tomcat1": URL_TOMCAT= "http://localhost:8080/manager/text"
     break
    case "tomcat2": URL_TOMCAT = "http://localhost:8089/manager/text"
     break  
  }
  </code></pre>
  
  <p>Then i want to get The URL_TOMCAT value and adjust the maven build step as shown:
  <a href="https://i.stack.imgur.com/FSo8c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FSo8c.png" alt="enter image description here"></a></p>
  
  <p>But i got this error : 
  <a href="https://i.stack.imgur.com/SdPGe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SdPGe.png" alt="enter image description here"></a></p>
  
  <p>Has any on an idea how to fix this error?</p>