DSL breaks when job run in folder

XMLWordPrintable

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor
    • Component/s: groovy-plugin
    • None

      The following executes fine at root level job, but fails when run in job in folder:

      import hudson.model.* 
      import static groovy.io.FileType.* 
      
      //Get current build environments variables 
      ///////////////////////////////////////////////////////////////////////////////
      
      def curJob=jenkins.model.Jenkins.instance.getItem(this.binding.build.project.name) 
      def curBuild=curJob.getLastBuild() 
      def curBuildEnvVars=curBuild.getEnvVars() 
      def curJobName=curBuildEnvVars['JOB_NAME']
      

            Assignee:
            vjuranek
            Reporter:
            Owen Wood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: