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

Pass custom parameters to job-dsl via pipeline step jobDsl

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      Be able to pass custom parameters to job scripts via the jobDsl pipeline step.

       

      Example:

      node {
          jobDsl targets: ['jobs/projectA/*.groovy', 'jobs/common.groovy'].join('\n'),
                 removedJobAction: 'DELETE',
                 removedViewAction: 'DELETE',
                 lookupStrategy: 'SEED_JOB',
                 params: [param1: 'test', param2: myExpr]
      }
      

       

      See: https://groups.google.com/forum/?fromgroups#!topic/job-dsl-plugin/_EtDfuvBhs4

          [JENKINS-44128] Pass custom parameters to job-dsl via pipeline step jobDsl

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          docs/User-Power-Moves.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java
          job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/c4ab6f942639555ef91d5ab889032cc61e077428
          Log:
          allow passing custom parameters from Pipeline script

          [FIXES JENKINS-44128]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md docs/User-Power-Moves.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/c4ab6f942639555ef91d5ab889032cc61e077428 Log: allow passing custom parameters from Pipeline script [FIXES JENKINS-44128]

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          docs/User-Power-Moves.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java
          job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy
          http://jenkins-ci.org/commit/job-dsl-plugin/08b03611dc1de0cf963e2fbf321a9ddf51fa7e87
          Log:
          Merge branch 'JENKINS-44128'

          Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/4abfaffe5df2...08b03611dc1d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md docs/User-Power-Moves.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/08b03611dc1de0cf963e2fbf321a9ddf51fa7e87 Log: Merge branch ' JENKINS-44128 ' Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/4abfaffe5df2...08b03611dc1d

          For folks wandering here by searches, the final implemented keyword in those diffs is "additionalParameters", not "params" as originally requested in the ticket description.

          Aaron D. Marasco added a comment - For folks wandering here by searches, the final implemented keyword in those diffs is " additionalParameters ", not " params " as originally requested in the ticket description.

          Christian V added a comment -

          Christian V added a comment - aarondmarasco_vsi It's also documented here: https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#use-job-dsl-in-pipeline-scripts

            vqrs Christian V
            vqrs Christian V
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: