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

Unable to create pipeline job from a template with "using" keyword

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • CloudBees Jenkins Enterprise 2.46.3.2-rolling
      Latest job-dsl version (1.64)

      I have the following dsl:

      pipelineJob("hello-pipeline") {

           using("/templates/hello") // where hello is a pipeline job
      }

      Got this exception:

      java.lang.NullPointerExceptionat javaposse.jobdsl.plugin.ExecuteDslScripts.updateTemplates(ExecuteDslScripts.java:380)at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:322)

      Looking at the source, this line seems to be the culprit:

      AbstractProject templateProject = getLookupStrategy().getItem(seedJob, templateName, AbstractProject.class);

        

          [JENKINS-45812] Unable to create pipeline job from a template with "using" keyword

          Cuong Tran added a comment -

          Should I take a stab at fixing this problem?

          Cuong Tran added a comment - Should I take a stab at fixing this problem?

          ctran thanks for the offer, I addressed this myself. It's going to be fixed in the next release.

          https://github.com/jenkinsci/job-dsl-plugin/pull/1052

          Daniel Spilker added a comment - ctran thanks for the offer, I addressed this myself. It's going to be fixed in the next release. https://github.com/jenkinsci/job-dsl-plugin/pull/1052

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java
          http://jenkins-ci.org/commit/job-dsl-plugin/ccf0dadcbe836e82a33c02ab1f3e3b44e0e6fb9e
          Log:
          fixed problem with using in Pipeline jobs

          [FIXES JENKINS-45812]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java http://jenkins-ci.org/commit/job-dsl-plugin/ccf0dadcbe836e82a33c02ab1f3e3b44e0e6fb9e Log: fixed problem with using in Pipeline jobs [FIXES JENKINS-45812]

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java
          http://jenkins-ci.org/commit/job-dsl-plugin/f1b120337eea24f08edfefbc002e39ccb7574406
          Log:
          Merge pull request #1052 from daspilker/JENKINS-45812

          JENKINS-45812 fixed problem with using in Pipeline jobs

          Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/b60e59e736c7...f1b120337eea

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java http://jenkins-ci.org/commit/job-dsl-plugin/f1b120337eea24f08edfefbc002e39ccb7574406 Log: Merge pull request #1052 from daspilker/ JENKINS-45812 JENKINS-45812 fixed problem with using in Pipeline jobs Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/b60e59e736c7...f1b120337eea

            daspilker Daniel Spilker
            ctran Cuong Tran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: