APIs related to integrating build data with Jira Software.
These APIs are available to Atlassian Connect apps. To use these APIs you must have the jiraBuildInfoProvider module in your Connect app's descriptor. See https://developer.atlassian.com/cloud/jira/software/modules/build/. They are also related to integrating Jira Software Cloud with on-premises tools using OAuth 2.0 credentials. See https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/.
These APIs are available to Forge apps with the devops:buildInfoProvider module in the Forge app's manifest. See https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-software-build-info/.
Update / insert builds data.
Builds are identified by the combination of pipelineId and buildNumber, and existing build data for the same
build will be replaced if it exists and the updateSequenceNumber of the existing data is less than the
incoming data.
Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are
available within a short period of time, but may take some time during peak load and/or maintenance times.
The getBuildByKey operation can be used to confirm that data has been stored successfully (if needed).
In the case of multiple builds being submitted in one request, each is validated individually prior to submission. Details of which build failed submission (if any) are available in the response object.
write:build-info:jiraConnect app scope required: WRITE
string
RequiredBuilds data to submit.
Properties
array<BuildData>
RequiredProviderMetadata
Submission accepted. Each submitted build that is of a valid format will be eventually available in Jira.
Details of which builds were submitted and which failed submission (due to data format problems etc.) are available in the response object.
The result of a successful submitBuilds request.
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
67
68
69
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestJira } from "@forge/bridge";
var bodyData = `{
"properties": {
"accountId": "account-234",
"projectId": "project-123"
},
"builds": [
{
"schemaVersion": "1.0",
"pipelineId": "my-build-plan",
"buildNumber": 16,
"updateSequenceNumber": 1523494301448,
"displayName": "My Project build #16",
"description": "My Project build #16: Failed",
"label": "<string>",
"url": "<string>",
"state": "failed",
"lastUpdated": "2018-01-20T23:27:25.000Z",
"issueKeys": [
"ISSUE-123"
],
"associations": [
{
"associationType": "issueIdOrKeys",
"values": [
"ABC-123",
"ABC-456"
]
}
],
"testInfo": {
"totalNumber": 150,
"numberPassed": 145,
"numberFailed": 5,
"numberSkipped": 0
},
"references": [
{
"commit": {
"id": "08cd9c26b2b8d7cf6e6af6b49da8895d065c259f",
"repositoryUri": "https://bitbucket.org/atlassian/biij-vendor-api"
},
"ref": {
"name": "feature/ISSUE-123-some-work",
"uri": "https://bitbucket.org/atlassian/biij-vendor-api/refs/feature/ISSUE-123-some-work"
}
}
]
}
],
"providerMetadata": {
"product": "Bamboo 6.10.2"
}
}`;
const response = await requestJira(`/rest/builds/0.1/bulk`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.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
32
33
34
{
"acceptedBuilds": [
{
"pipelineId": "my-build-plan",
"buildNumber": 16
}
],
"rejectedBuilds": [
{
"key": {
"pipelineId": "my-build-plan",
"buildNumber": 16
},
"errors": [
{
"message": "<string>",
"errorTraceId": "<string>"
}
]
}
],
"unknownIssueKeys": [
"ISSUE-123"
],
"unknownAssociations": [
{
"associationType": "issueIdOrKeys",
"values": [
"ABC-123",
"ABC-456"
]
}
]
}Bulk delete all builds data that match the given request.
One or more query params must be supplied to specify Properties to delete by.
Optional param _updateSequenceNumber is no longer supported.
If more than one Property is provided, data will be deleted that matches ALL of the
Properties (e.g. treated as an AND).
See the documentation for the submitBuilds operation for more details.
e.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345
Deletion is performed asynchronously. The getBuildByKey operation can be used to confirm that data has been
deleted successfully (if needed).
delete:build-info:jiraConnect app scope required: DELETE
integer
string
RequiredDelete accepted. Data will eventually be removed from Jira.
1
2
3
4
5
6
7
8
9
10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestJira } from "@forge/bridge";
const response = await requestJira(`/rest/builds/0.1/bulkByProperties`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());Retrieve the currently stored build data for the given pipelineId and buildNumber combination.
The result will be what is currently stored, ignoring any pending updates or deletes.
read:build-info:jiraConnect app scope required: READ
string
Requiredinteger
Requiredstring
RequiredThe build data currently stored for the given key.
Data related to a single build
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestJira } from "@forge/bridge";
const response = await requestJira(`/rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.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
32
33
34
35
36
37
38
39
40
41
42
{
"schemaVersion": "1.0",
"pipelineId": "my-build-plan",
"buildNumber": 16,
"updateSequenceNumber": 1523494301448,
"displayName": "My Project build #16",
"description": "My Project build #16: Failed",
"label": "<string>",
"url": "<string>",
"state": "failed",
"lastUpdated": "2018-01-20T23:27:25.000Z",
"issueKeys": [
"ISSUE-123"
],
"associations": [
{
"associationType": "issueIdOrKeys",
"values": [
"ABC-123",
"ABC-456"
]
}
],
"testInfo": {
"totalNumber": 150,
"numberPassed": 145,
"numberFailed": 5,
"numberSkipped": 0
},
"references": [
{
"commit": {
"id": "08cd9c26b2b8d7cf6e6af6b49da8895d065c259f",
"repositoryUri": "https://bitbucket.org/atlassian/biij-vendor-api"
},
"ref": {
"name": "feature/ISSUE-123-some-work",
"uri": "https://bitbucket.org/atlassian/biij-vendor-api/refs/feature/ISSUE-123-some-work"
}
}
]
}Delete the build data currently stored for the given pipelineId and buildNumber combination.
Deletion is performed asynchronously. The getBuildByKey operation can be used to confirm that data has been
deleted successfully (if needed).
delete:build-info:jiraConnect app scope required: DELETE
string
Requiredinteger
Requiredinteger
string
RequiredDelete has been accepted. Data will eventually be removed from Jira if it exists.
1
2
3
4
5
6
7
8
9
10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestJira } from "@forge/bridge";
const response = await requestJira(`/rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());Rate this page: