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

Unable to view parameters created in post build to pass them as part of promote build plugin

XMLWordPrintable

      Hi,

      I am trying to capture few values from the output window using Groovy script - Regular expressions. I have observed that the captured value is not being saved into newly created string parameter. Please find below the grrovy script which was used.

      Jenkins version - 2.73.2

      Promoted Build plugin version - 2.31

       

      I have gone through few blogs and its been suggested to change system properties with the below statment but I am getting an error while running the same.

      hudson.model.ParametersAction.safeParameters to a comma-separated list of safe parameter names

       

      import hudson.model.*

      def matcher = manager.getLogMatcher('setting scenario result folder to (.*)LRR$')

      if (matcher.matches()) {
      resDir=matcher.group(1)
      manager.build.addAction(
      new ParametersAction([
      new StringParameterValue("RES_DIR", "${resDir}")
      ])
      )
      }

      manager.listener.logger.println "${resDir}"
      manager.listener.logger.println "$RES_DIR" - getting error for this statement
      matcher = manager.getLogMatcher('DATE.*)$')

      if (matcher.matches()) {
      buildDate=matcher.group(1)
      manager.build.addAction(
      new ParametersAction([
      new StringParameterValue("RES_TIMESTAMP", "${buildDate}")
      ])
      )
      }

      manager.listener.logger.println("Hello 1");
      manager.listener.logger.println "$RES_TIMESTAMP";- getting error for this statement

            amith_arangi Amith Arangi
            amith_arangi Amith Arangi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: