Commit statuses provide a way to tag commits with meta data, like automated build results.
Returns all statuses (e.g. build results) for a specific commit.
repositoryread:repository:bitbucketstring
Requiredstring
Requiredstring
Requiredstring
string
string
A paginated list of all commit statuses for this commit.
A paginated list of commit status objects.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'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
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}
]
}Creates a new build status against the specified commit.
If the specified key already exists, the existing status object will be overwritten.
Example:
1 2 3 4 5 6curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result" }'
When creating a new commit status, you can use a URI template for the URL.
Templates are URLs that contain variable names that Bitbucket will
evaluate at runtime whenever the URL is displayed anywhere similar to
parameter substitution in
Bitbucket Connect.
For example, one could use https://foo.com/builds/{repository.full_name}
which Bitbucket will turn into https://foo.com/builds/foo/bar at render time.
The context variables available are repository and commit.
To associate a commit status to a pull request, the refname field must be set to the source branch of the pull request.
Example:
1 2 3 4 5 6 7curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result", "refname": "my-pr-branch" }'
repositoryread:repository:bitbucketstring
Requiredstring
Requiredstring
RequiredThe new commit status object.
allOf [object, Commit Status]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A commit status object.
The newly created build status object.
allOf [object, Commit Status]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A commit status object.
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
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}Returns the specified build status for a commit.
repositoryread:repository:bitbucketstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe build status object with the specified key.
allOf [object, Commit Status]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A commit status object.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}Used to update the current status of a build status object on the specific commit.
This operation can also be used to change other properties of the build status:
statenamedescriptionurlrefnameThe key cannot be changed.
repositoryread:repository:bitbucketstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe updated build status object
allOf [object, Commit Status]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A commit status object.
The updated build status object.
allOf [object, Commit Status]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A commit status object.
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
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}Rate this page: