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

Referenced parameters not passed to groovy script for reactive reference

      Groovy script works in the script console but not in the Active Choices Reactive Reference Parameter.

      Log for the plugin gives:

      groovy.lang.MissingPropertyException: No such property: VSIM_PROJ for class: Script1

      Referenced Parameters: VSIM_PROJ,VSIM_BUILD

      groovy script:

      import jenkins.model.Jenkins
      import hudson.model.AbstractProject
      import hudson.model.Result
      import hudson.util.RunList
      
      AbstractProject<?, ?> otherJob = Jenkins.getInstance().getItemByFullName(VSIM_PROJ, AbstractProject.class)
      
      def otherBuild = otherJob.getBuildByNumber(VSIM_BUILD)
      def dispName = otherBuild.displayName
      
      return "${dispName }"
      

          [JENKINS-37935] Referenced parameters not passed to groovy script for reactive reference

          Jason Grosch created issue -
          Bruno P. Kinoshita made changes -
          Description Original: Groovy script works in the script console but not in the Active Choices Reactive Reference Parameter.

          Log for the plugin gives:

          groovy.lang.MissingPropertyException: No such property: VSIM_PROJ for class: Script1


          Referenced Parameters: VSIM_PROJ,VSIM_BUILD

          groovy script:

          import jenkins.model.Jenkins
          import hudson.model.AbstractProject
          import hudson.model.Result
          import hudson.util.RunList

          AbstractProject<?, ?> otherJob = Jenkins.getInstance().getItemByFullName(VSIM_PROJ, AbstractProject.class)

          def otherBuild = otherJob.getBuildByNumber(VSIM_BUILD)
          def dispName = otherBuild.displayName

          return "${dispName }"
          New: Groovy script works in the script console but not in the Active Choices Reactive Reference Parameter.

          Log for the plugin gives:

          groovy.lang.MissingPropertyException: No such property: VSIM_PROJ for class: Script1


          Referenced Parameters: VSIM_PROJ,VSIM_BUILD

          groovy script:

          {code}
          import jenkins.model.Jenkins
          import hudson.model.AbstractProject
          import hudson.model.Result
          import hudson.util.RunList

          AbstractProject<?, ?> otherJob = Jenkins.getInstance().getItemByFullName(VSIM_PROJ, AbstractProject.class)

          def otherBuild = otherJob.getBuildByNumber(VSIM_BUILD)
          def dispName = otherBuild.displayName

          return "${dispName }"
          {code}
          Bruno P. Kinoshita made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Bruno P. Kinoshita made changes -
          Summary Original: Referenced parameters not passed to groovy script for reactive refernence New: Referenced parameters not passed to groovy script for reactive reference
          Bruno P. Kinoshita made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            kinow Bruno P. Kinoshita
            grush128 Jason Grosch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: