Addon
Branch restrictions
Branching model
Commit statuses
Commits
Deployments
Downloads
Issue tracker
Pipelines
Projects
Pullrequests
Refs
Reports
Repositories
Snippets
Source
Ssh
Users
Webhooks
Workspaces
Other operations

Rate this page:

Issue tracker

The issue resources provide functionality for getting information on issues in an issue tracker, creating new issues, updating them and deleting them. You can access public issues without authentication, but you can't gain access to private repositories' issues. By authenticating, you will get the ability to create issues, as well as access to updating data or deleting issues you have access to.

List components

GET /2.0/repositories/{workspace}/{repo_slug}/components

Returns the components that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.

issue

Request

Path parameters
repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/components' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

The components that have been defined in the issue tracker.

Content typeValue
application/json

Paginated Components

Get a component for issues

GET /2.0/repositories/{workspace}/{repo_slug}/components/{component_id}

Returns the specified issue tracker component object.

issue

Request

Path parameters
component_id Required

integer

The component's id

repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/components/{component_id}' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

The specified component object.

Content typeValue
application/json

allOf [object, Component]

List issues

GET /2.0/repositories/{workspace}/{repo_slug}/issues

Returns the issues in the issue tracker.

issue

Request

Path parameters
repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/issues' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

A paginated list of the issues matching any filter criteria that were provided.

Content typeValue
application/json

Paginated Issues

Create an issue

POST /2.0/repositories/{workspace}/{repo_slug}/issues

Creates a new issue.

This call requires authentication. Private repositories or private issue trackers require the caller to authenticate with an account that has appropriate authorization.

The authenticated user is used for the issue's reporter field.

issue:write

Request

Path parameters
repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Body parameters
Content typeValue
application/json

allOf [object, Issue]

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
curl --request POST \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/issues' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "<string>",
  "links": {
    "self": {
      "href": "<string>",
      "name": "<string>"
    },
    "html": {
      "href": "<string>",
      "name": "<string>"
    },
    "comments": {
      "href": "<string>",
      "name": "<string>"
    },
    "attachments": {
      "href": "<string>",
      "name": "<string>"
    },
    "watch": {
      "href": "<string>",
      "name": "<string>"
    },
    "vote": {
      "href": "<string>",
      "name": "<string>"
    }
  },
  "id": 2154,
  "repository": {
    "type": "<string>"
  },
  "title": "<string>",
  "reporter": {
    "type": "<string>"
  },
  "assignee": {
    "type": "<string>"
  },
  "created_on": "<string>",
  "updated_on": "<string>",
  "edited_on": "<string>",
  "state": "new",
  "kind": "bug",
  "priority": "trivial",
  "milestone": {
    "type": "<string>"
  },
  "version": {
    "type": "<string>"
  },
  "component": {
    "type": "<string>"
  },
  "votes": 2154,
  "content": {
    "raw": "<string>",
    "markup": "markdown",
    "html": "<string>"
  }
}'

Responses

The newly created issue.

Content typeValue
application/json

allOf [object, Issue]

Header Parameters
Location

string

The (absolute) URL of the newly created issue.

Export issues

POST /2.0/repositories/{workspace}/{repo_slug}/issues/export

A POST request to this endpoint initiates a new background celery task that archives the repo's issues.

For example, you can run:

curl -u -X POST http://api.bitbucket.org/2.0/repositories/<owner_username>/<repo_slug>/ issues/export

When the job has been accepted, it will return a 202 (Accepted) along with a unique url to this job in the 'Location' response header. This url is the endpoint for where the user can obtain their zip files."

issue
,
repository:admin

Request

Path parameters
repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Body parameters

Options for issue export.

type Required

string

project_key

string

project_name

string

send_email

boolean

include_attachments

boolean

Additional Properties

anything

Extra properties of any type may be provided to this object.

Example

1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/issues/export' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "<string>",
  "project_key": "<string>",
  "project_name": "<string>",
  "send_email": true,
  "include_attachments": true
}'

Responses

The export job has been accepted

A schema has not been defined for this response code.

Check issue export status

GET /2.0/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip

This endpoint is used to poll for the progress of an issue export job and return the zip file after the job is complete. As long as the job is running, this will return a 200 response with in the response body a description of the current status.

After the job has been scheduled, but before it starts executing, this endpoint's response is:

{ "type": "issue_job_status", "status": "ACCEPTED", "phase": "Initializing", "total": 0, "count": 0, "pct": 0 }

Then once it starts running, it becomes:

{ "type": "issue_job_status", "status": "STARTED", "phase": "Attachments", "total": 15, "count": 11, "pct": 73 }

Once the job has successfully completed, it returns a stream of the zip file.

issue
,
repository:admin

Request

Path parameters
repo_name Required

string

The name of the repo

repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

task_id Required

string

The ID of the export task

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Export job accepted

Content typeValue
application/json

Issue Job Status

Check issue import status

GET /2.0/repositories/{workspace}/{repo_slug}/issues/import

When using GET, this endpoint reports the status of the current import task. Request example:

1
2
$ curl -u <username> -X GET https://api.bitbucket.org/2.0/repositories/<owner_username>/<repo_slug>/issues/import

After the job has been scheduled, but before it starts executing, this endpoint's response is:

1
2
< HTTP/1.1 202 Accepted
{
    "type": "issue_job_status",
    "status": "PENDING",
    "phase": "Attachments",
    "total": 15,
    "count": 0,
    "percent": 0
}

Once it starts running, it is a 202 response with status STARTED and progress filled.

After it is finished, it becomes a 200 response with status SUCCESS or FAILURE.

issue:write
,
repository:admin

Request

Path parameters
repo_slug Required

string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace Required

string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/issues/import' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Import job complete with either FAILURE or SUCCESS status

Content typeValue
application/json

Issue Job Status

Import issues

POST /2.0/repositories/{workspace}/{repo_slug}/issues/import

A POST request to this endpoint will import the zip file given by the archive parameter into the repository. All existing issues will be deleted and replaced by the contents of the imported zip file.

Imports are done through a multipart/form-data POST. There is one valid and required form field, with the name "archive," which needs to be a file field:

1
2
$ curl -u <username> -X POST -F archive=@/path/to/file.zip https://api.bitbucket.org/2.0/repositories/<owner_username>/<repo_slug>/issues/import

When the import job is accepted, here is example output:

1
2
< HTTP/1.1 202 Accepted

{
    "type": "issue_job_status",
    "status": "ACCEPTED",
    "phase": "Attachments",
    "total": 15,
    "count": 0,
    "percent": 0
}
issue:write
,
repository:admin

Request