Data pipeline export schema

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

This page describes the structure and data schema of the Bitbucket data export files.

To learn more about how the set up and configure your data pipeline, see Data pipeline.

Output file format and structure

The output files are written in CSV format and are RFC4180 compliant. They have the following characteristics:

  • Each file has a header. This includes files from exports that resulted in no data.
  • New lines are separated by CRLF characters \r\n.
  • Fields containing line breaks (CRLF), double quotes, and commas are enclosed in double quote.
  • If double-quotes are present inside fields, then a double-quote appearing inside a field are escaped by preceding it with another double quote. For example: "aaa", "b""bb", "ccc".
  • Fields with no data (null values) are represented in the CSV export by two consecutive delimiters (as in, ,,).
  • Embedded break lines are escaped by default and printed as n. 

Availability

The data exported depends on your Bitbucket version. 

Required Bitbucket version...
TableBitbucket version
Repositories7.13
Commits7.13
Pull requests7.13
Pull request activities7.15
Users7.13

Individual fields are available in all schema versions, unless specifically noted in the tables below.

On this page:

Users file

FieldDescription
user_id

Type: String

Description: ID of the user

Example: 2853030

instance_url

Type: URL

Description: Base URL of the current instance.

Example: https://yoursitename.com

user_name

Type: String

Description: User name of the user.

Example: jsmith

user_fullname

Type: String

Description: Full name of the user.

Example: John Smith

user_email

Type: Email

Description: Email address of the user.

Example: jsmith@example.com

Repositories file

FieldDescription

repository_id

Type: Number

Description: Unique identifier for the repository.

Example: 23

instance_url

Type: URL

Description: Base URL of the current instance.

Example: https://yoursitename.com

url

Type: String

Description: URL of the repository.

Example: http://yoursitename.com/projects/SAM/repos/sample-repo

repository_name

Type: String

Description: Name of the repository.

Example: Sample repo

description

Type: String

Description: Description of the repository.

hierarchy_id

Type: Number

Description: The unique identifier for the hierarchy of forks to which this repository belongs. All repositories have a hierarchy ID, even if they have no forks.

Example: d536510043f3b4bb4f77

origin

Type: String

Description: Repository from which this repository was forked, if any.

Example: SAMPLE/my-fork

project_id

Type: Number

Description: Unique identifier for the project.

Example: 19

project_key

Type: String

Description: Key of the project this repo is contained in.

Example: SAM

project_name

Type: String

Description: Name of the project this repo is contained in.

Example: Sample Project

project_type

Type: String

Description: Whether the project the repository is contained in is normal or personal.

Example: Personal

forkable

Type: Boolean

Description: ‘Allow forks’ is selected in the repository settings.

Example: True

fork

Type: Boolean

Description: Repository is forked from another repository.

Example: False

public

Type: Boolean

Description: Whether ‘Public access’ is enabled in the repository settings.

Example: False

Commits file

FieldDescription

commit_hash

Type: String

Description: Unique identifier of the commit.

Example: fc57795ddd877f00e51ab9f51a929220b1a5337b

instance_url

Type: URL

Description: Base URL of the current instance.

Example: https://yoursitename.com

url

Type: URL

Description: URL of the commit.

Example: https://yoursitename.com/projects/SAM/repos/sample-repo/commits/fc57795ddd877f00e51ab9f51a929220b1a5337b

commit_message

Type: String

Description: Commit message included with the commit.

repository_id

Type: Number

Description: Unique identifier for the repository.

Example: 23

author_email

Type: String

Description: Email address of the author of the committed code. If the author is not a Bitbucket user, this email will not map to a user in the users table.

Example: jsmith@example.com

authored_date

Type: Date

Description: Date and time the commit was made.

Example: 2021-02-04 00:43

committer_email

Type: String

Description: Email address of the user who committed the code. If the committer is not a Bitbucket user, this email will not map to a user in the users table.

Example: jsmith@example.com

committed_date

Type: Date

Description: Date and time the commit was last modified.

Example: 2021-02-04 00:43

Pull requests file

FieldDescription

pull_request_id

Type: String

Description: Unique identifier of the pull request. It is a combination to_repository_id & scoped_id.

Example: 23-16

scoped_id

Type: Number

Description: Identifier for the pull request. This ID is only unique within each repository.

Example: 16

instance_url

Type: URL

Description: Base URL of the current instance.

Example: https://yoursitename.com

url

Type: String

Description: URL of the pull request.

Example: http://yoursitename.com/projects/SAM/repos/sample-repo/pull-requests/132/

title

Type: String

Description: Title of the pull request.

Example: TEST-123 fix broken tests

description

Type: String

Description: Description included with the pull request, limited to XXX characters.

author_id

Type: Number

Description: Unique identifier of the person who created the pull request.

Example: 2853030

created_date

Type: Date

Description: Date the pull request was created.

Example: 2021-01-03 20:57

updated_date

Type: Date

Description: Date the pull request was updated.

Example: 2021-01-03 23:06

closed_date

Type: Date

Description: Date the pull request was closed.

Example: 2021-01-03 23:06

from_branch_name

Type: String

Description: The name of the source branch.

Example: Improve-tests

from_commit_hash

Type: String

Description: The commit hash for the earliest commit in this pull request.

Example: c149b9a3a37fd211613aaf9390866d1778172a07

from_repository
_id

Type: Number

Description: Unique identifier for the source repository.

Example: 16

to_branch_name

Type: String

Description: The name of the destination branch.

Example: Master

to_commit_hash

Type: String

Description: The commit hash for the latest commit in this pull request.

Example: d149b9a3a37fd211613aaf9390866d1778172a56

to_repository_id

Type: Number

Description: Unique identifier for the destination repository.

Example: 23

version

Type: Number

Description: Version number represents the number of times the pull request has been updated.

Example: 3

state

Type: String

Description: Current status of the pull request. Can be MERGED, DECLINED, or OPEN.

Example: MERGED

participant_count

Type: Number

Description: Number of participants on the pull request.

reviewer_count

Type: Number

Description: Number of reviewers on the pull request.

approvals_count

Type: Number

Description: Number of approvals on the pull request.

comments_count

Type: Number

Description: Number of comments on the pull request.

tasks_count

Type: Number

Description: Total number of tasks on the pull request.

resolved_tasks_
count

Type: Number

Description: Number of tasks resolved on the pull request.

time_to_merge

Type: Number

Description: Time between pull request creation and merge, in milliseconds.

Example: 24800

Pull request activity file

The historical activity for each pull request will be exported to pull_request_activities CSV file.  Only activity after the export fromDate will be included.

Use the pull_request_id field to join this table to the pull requests table.

FieldDescription

pull_request_id

Type: String

Description: Unique identifier of the pull request. It is a combination to_repository_id & scoped_id.

Example: 23-16

author_id

Type: Number

Description: Unique identifier of the person who created the pull request.

Example: 2853030

created_date

Type: Date

Description: Date the action performed on the pull request.

Example: 2021-01-03 20:57

action

Type: String

Description: The action performed on the pull request, for example created, updated, reviewed, commented, declined, approved, and merged.

Example: MERGED

additional_information

Type: String

Description: Any additional information associated with the change, in JSON format.

Example:

{"comment_id":59,"
"comment_action":"EDITED",
"author_id":2,
"severity":"BLOCKER",
"state":"RESOLVED",
"text":"sample comment",
"thread":39,
"resolved_date":"2021-06-14T13:08:10Z"}

There are some situations where the created date and user ID may be incorrect in the pull request activities file. This is due to a historical issue, that was resolved in Bitbucket 7.14. For comments edited before the fix, the original created date and user ID was returned in the export, rather than the edited date and user ID.


Build status file (optional)

Exporting build statuses can take a significant amount of time depending on the number of build statuses that might be associated with a commit. For this reason, exporting this data is disabled by default. Set the plugin.data.pipeline.bitbucket.export.build.statuses system property to true to enable it.
FieldDescription

commit_hash

Type: String

Description: Commit hash for the commit.

Example: fc57795ddd877f00e51ab9f51a929220b1a5337b

repository_id

Type: Number

Description: Unique identifier of the repository.

Example: 23

build_key

Type: String

Description: Key set in your CI tool. Can be used as a unique identifier when combined with repository ID and commit ID.

Example: SAMPLE-PLAN123

build_url

Type: String

Description: URL of the build in your CI tool.

Example: https://bamboo.example.com/browse/SAMPLE-PLAN123-8

build_name

Type: String

Description: Name of the build.

Example: Pre-release build

build_number

Type: Number

Description: The identifier for the specific run that resulted in this build status. May be empty.

Example: 8

build_description

Type: String

Description: Description of the specific run that resulted in this build status.

Example: #8 successful\nin 7 minutes

build_duration

Type: Number

Description: Duration of the build, in milliseconds.

Example: 230400

build_created_date

Type: Date

Description: Date the build was created.

Example: 2021-01-27 22:55

build_updated_date

Type: Date

Description: Date the build was updated.

Example: 2021-01-27 22:55

build_state

Type: String

Description: State of the build. Can include SUCCESSFUL / FAILED / INPROGRESS

Example: SUCCESSFUL

build_parent

Type: String

Description: Key of the parent build for this plan. Can be empty.

Example: PLAN

build_ref

Type: String

Description: The branch or tag that this build is associated with. Can be empty.

build_successful_
tests

Type: Number

Description: The number of successful tests in this build.

build_failed_tests

Type: Number

Description: The number of failed tests in this build.

build_skipped_tests

Type: Number

Description: The number of skipped tests in this build.

Last modified on May 31, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.