title: How to access a specific Jenkins job parameter from within a JobDSL?
body: <p>My question is very related to <a href="https://stackoverflow.com/q/31394647/7111561">How to access list of Jenkins job parameters from within a JobDSL script?</a></p>
  
  <p>With the diference: How can I access one specific parameter within the DSL script? </p>
  
  <p>I tried to figure it out from the answers in the mentioned question but couldn't figure it out.</p>
  
  <p>Let's say the parameter is named <code>REPOSITORY_NAME</code>.
  I tried to use the code from the accepted answer and do something like</p>
  
  <pre><code>import hudson.model.*
  
  Build build = Executor.currentExecutor().currentExecutable
  ParametersAction parametersAction = build.getAction(ParametersAction)
  def newname = parametersAction.parameters['REPOSITORY_NAME'].ParameterValue 
  
  println newname
  </code></pre>
  
  <p>but I only got</p>
  
  <blockquote>
    <p>ERROR: (script, line 5) Exception evaluating property 'REPOSITORY_NAME' for java.util.Collections$UnmodifiableRandomAccessList, Reason: groovy.lang.MissingPropertyException: No such property: REPOSITORY_NAME for class: hudson.model.StringParameterValue</p>
  </blockquote>
  
  <p>I also tried</p>
  
  <pre><code>def newname = parametersAction.parameters.getParameter('REPOSITORY_NAME').ParameterValue
  </code></pre>
  
  <p>instead but it gave me</p>
  
  <blockquote>
    <p>ERROR: (script, line 5) No signature of method: java.util.Collections$UnmodifiableRandomAccessList.getParameter() is applicable for argument types: (java.lang.String) values: [REPOSITORY_NAME]</p>
  </blockquote>
  
  <p><strong>What do I have to change to make this work?</strong></p>