Copy Artifacts from Another Job

If your application depends on artifacts from another job, you can configure the job to copy those artifacts when a build is run:

  1. Open the job’s configuration page.

  2. Click Configure Configure.

  3. Click the Before Build tab.

  4. Click Add Before Build Action and select Copy Artifacts.

  5. In From Job, select the job whose artifacts you want to copy.

  6. In Which Build, select the build that generated the artifacts.

  7. If you select the Use last successful build if not run in pipeline option, the last successful (other) build will be used if this build isn't run in a pipeline.

    The build will fail if you don't select the option but do select the upstream build in the previous step and don't run the build in a pipeline.

  8. In Artifacts to copy, specify the artifacts to copy. When a build runs, the artifacts are copied with their relative paths.

    If you don't specify a value, the build will copy all artifacts. The archive.zip file is never copied.

  9. In Target Directory, specify the workspace directory where the artifacts will be copied.

  10. To flatten the directory structure of the copied artifacts, select Flatten Directories.

  11. By default, if a build can’t copy artifacts, it'll be marked as failed. If you don’t want the build to be marked as failed, select Optional (Do not fail build if artifacts copy failed).

  12. Click Save.