Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53103

Pipeline does not pass environment variables to JobDsl

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • job-dsl-plugin
    • None
    • Jenkins: 2.121.1
      OS: Ubuntu 16.04
      DSL Plugin: 1.63

      Hello Folks,

      I have a regular Freestyle job that uses Process  Job DSLs step to run a  Groovy script.

      The Groovy script  references ${WORKSPACE} with out any issues.

       

      If I try to do the same from a  declarative pipeline the groovy scripts is not able to resolve ${WORKSPACE}

      line 24) No such property: WORKSPACE for class:

      I have looked at this issue

      https://issues.jenkins-ci.org/browse/JENKINS-44128

      but  that solution does not work because  additionalParameters is not supported by the  current DSL

       

      WorkflowScript: 99: Invalid parameter "additionalParameters", did you mean "additionalClasspath"? @ line 99, column 21.
      additionalParameters: [message: 'foo']
      ^

      1 error

       

       

      Thanks in advance for the help

      /Sam

       

            daspilker Daniel Spilker
            saml Samuel Lopez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: