How to Export Bitbucket Pipelines Minutes Usage Report in Bitbucket Cloud

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

Summary

Currently, Bitbucket Cloud does not have the functionality to show a report of the minutes used at the pipeline level or repository level. An open feature request is with our development team to include this within the platform. As an alternative, the build statistics pipe can be used to provide this information.

Solution

Option 1: Store the pipeline report as a TXT file artifact.  

The file will be created in the BITBUCKET_CLONE_DIR directory. Here is a sample code snippet to configure this:

Here is a sample code snippet to configure this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 pipelines: default: - step: name: "Pipeline Build Statistics" artifacts: - build-minutes.txt script: - pipe: atlassian/bitbucket-build-statistics:1.5.3 variables: BITBUCKET_USERNAME: $BITBUCKET_USERNAME BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD FILENAME: "build_usage.txt" - ls $BITBUCKET_CLONE_DIR - cat build_usage.txt

Option 2: Store the pipeline report as a JSON artifact:

The JSON file can be downloaded, and data can be programmatically processed. Here is a sample code snippet to configure this:

Here is a sample code snippet to configure this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pipelines: default: - step: name: "Pipeline Build Statistics" artifacts: - build-minutes.json script: - pipe: atlassian/bitbucket-build-statistics:1.5.3 variables: BITBUCKET_USERNAME: $BITBUCKET_USERNAME BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD FILENAME: "build_usage" OUTPUT_FILE_FORMAT: "json" - ls $BITBUCKET_CLONE_DIR - cat build_usage.json

Updated on March 4, 2025

Still need help?

The Atlassian Community is here for you.