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

Easy way to pass a value from a build back to the flow

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • build-flow-plugin
    • None

      People often ask how you can pass a value from one build step to another in a Flow, or generally to retrieve information from builds. If you are willing to write the value to an archived file in the first build, you can use a function like

      def artifact(build, name) {
        new File(build.artifactsDir, name).text.trim();
      }
      

      This works, but the Flow plugin should define something like this (or better) out of the box.

      (Also https://github.com/jenkinsci/jenkins/pull/736 would change the Jenkins API here, so it is better that the plugin take care of that detail.)

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: