Rate this page:
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.
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
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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'
The components that have been defined in the issue tracker.
Content type | Value |
---|---|
application/json |
GET /2.0/repositories/{workspace}/{repo_slug}/components/{component_id}
Returns the specified issue tracker component object.
issue
integer
The component's id
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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'
GET /2.0/repositories/{workspace}/{repo_slug}/issues
Returns the issues in the issue tracker.
issue
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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'
A paginated list of the issues matching any filter criteria that were provided.
Content type | Value |
---|---|
application/json |
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
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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>"
}
}'
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
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
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
Options for issue export.
string
string
string
boolean
boolean
anything
Extra properties of any type may be provided to this object.
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
}'
The export job has been accepted
A schema has not been defined for this response code.
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
string
The name of the repo
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
The ID of the export task
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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'
Export job accepted
Content type | Value |
---|---|
application/json |
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
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
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'
Import job complete with either FAILURE or SUCCESS status
Content type | Value |
---|---|
application/json |
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