title: Getting java.lang.IllegalArgumentException: One or more variables have some issues with their values in jenkins pipeline
body: <p>I have a Jenkins declarative pipeline wherein I am trying to store the value returned from a method into environment variable as shown below.</p>
  <pre><code>steps {
                  
                  script {
                      
                      def job = getJob(JOB_NAME)
                      def param = getParam(job, &quot;Ser&quot;)
                      echo param.getValue()
                  }
                  
                  
              }
              environment {
                  p_values = param.getValue()
              }
  </code></pre>
  <p>But while running above script I am getting below error.</p>
  <pre><code>java.lang.IllegalArgumentException: One or more variables have some issues with their values: p_values
  </code></pre>
  <p>Could you please assist me here to resolve this issue?</p>