Artifacts don't copy to the second stage if the first task is NOT a VCS checkout task

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

A sample scenario: The first stage of a plan generates project dependencies to pass on to later stages. This successfully puts those files in a artifact called "A" which reads out of the "Test" directory on that stage. There are two other stages that need to consume that artifact. The first stage gets the artifact just fine. The second stage shows the "A" artifact run successfully (as per the log file) but the artifact doesn't actually show up in the work space/build directory.

Cause

This is an interference between artifact download and 'Force clean build'. Normally VCS Checkout task is the first one, then artifacts are downloaded. If the first task is not a "VCS Checkout task" and is a command task for example, Bamboo 'thinks' that it should download artifacts as the first thing. Then VCS Checkout task starts, which clears everything. The reason/fix for this behavior is maintaining backward compatibility with Jobs created before Multiple Repositories feature. We are in the process of having this work properly and fixed by providing customers better control over downloading artifacts.

Workaround

At the moment ONE of the following workarounds should resolve the problem:

Option 1) Moving the first task after the source checkout.

Option 2) Turning 'Force clean build' off and use 'Clean working directory after each build' instead (This option can be found under each Job's Miscellaneous tab).

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.