Create a default reviewer pull request condition for the given project.
string
RequiredThe details needed to create a default reviewer pull request condition.
integer
array<RestReviewerGroup>
array<RestApplicationUser>
object
object
The default reviewer pull request condition that was created.
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
curl --request POST \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/condition' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredApprovals": 1,
"reviewerGroups": [
{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
],
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
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
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
Update the default reviewer pull request condition for the given ID.
string
Requiredstring
RequiredThe new details for the default reviewer pull request condition.
integer
array<RestReviewerGroup>
array<RestApplicationUser>
object
object
The updated default reviewer pull request condition.
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
curl --request PUT \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/condition/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredApprovals": 1,
"reviewerGroups": [
{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
],
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
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
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
Delete the default reviewer pull request condition associated with the given ID.
string
Requiredstring
RequiredAn empty response indicating that the pull request condition was deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/condition/{id}'
Return a page of default reviewer pull request conditions that have been configured for this project.
string
RequiredThe default reviewer pull request conditions associated with the given project.
array<RestPullRequestCondition>
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/conditions' \
--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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
]
Create a default reviewer pull request condition for the given repository.
string
Requiredstring
RequiredThe details needed to create a default reviewer pull request condition.
integer
array<RestReviewerGroup>
array<RestApplicationUser>
object
object
The default reviewer pull request condition that was created.
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
curl --request POST \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredApprovals": 1,
"reviewerGroups": [
{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
],
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
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
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
Update the default reviewer pull request condition for the given ID.
string
Requiredstring
Requiredstring
Requiredinteger
array<RestReviewerGroup>
array<RestApplicationUser>
object
object
The updated default reviewer pull request condition.
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
curl --request PUT \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredApprovals": 1,
"reviewerGroups": [
{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
],
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
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
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
Delete the default reviewer pull request condition associated with the given ID.
string
Requiredinteger
Requiredstring
RequiredAn empty response indicating that the pull request condition was deleted
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}'
Return a page of default reviewer pull request conditions that have been configured for this repository.
string
Requiredstring
RequiredThe default reviewer pull request conditions associated with the given repository.
array<RestPullRequestCondition>
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions' \
--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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
]
Return a set of users who are required reviewers for pull requests created from the given source repository and ref to the given target ref in this repository.
string
Requiredstring
Requiredstring
string
string
string
The default reviewer pull request conditions associated with the given repository.
array<RestPullRequestCondition>
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewers' \
--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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[
{
"id": 1,
"requiredApprovals": 1,
"reviewerGroups": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"reviewers": [
{
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{}
]
}
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"sourceRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetRefMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}
]
Checks preconditions to determine whether the pull request can be rebased.
Some of the preconditions are:
refs/heads/
git rebase
records the current user as the committer for the rebased commits, which requires a name and e-mail addressThis list is not exhaustive, and the exact set of preconditions applied can be extended by third-party add-ons.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe rebaseability status of the pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase' \
--header 'Accept: application/json;charset=UTF-8'
Rebases the specified pull request, rewriting the incoming commits to start from the tip commit of the pull request's target branch. This operation alters the pull request's source branch and cannot be undone.
The authenticated user must have REPO_READ permission for the repository that this pull request targets and REPO_WRITE permission for the pull request's source repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe pull request rebase request.
integer
The merged pull request.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"version": 1
}'
Add an emoticon reaction to a pull request comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}' \
--header 'Accept: application/json;charset=UTF-8'
Remove an emoticon reaction from a pull request comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}'
Retrieve the merge strategies available for this instance. The user must be authenticated to call this resource.
string
RequiredThe merge configuration of this instance.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \
--header 'Accept: application/json;charset=UTF-8'
Update the pull request merge strategies for the context repository.
The authenticated user must have ADMIN permission to call this resource.
Only the strategies provided will be enabled, only one may be set to default
The commit message template will not be updated if not provided, and will be deleted if the commitMessageTemplate
attribute is empty, i.e: commitMessageTemplate: {}
.
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty mergeConfig
attribute. i.e:
1 2 3
{ "mergeConfig": {} }
Upon completion of this request, the effective configuration will be the default configuration.
string
Requiredthe settings
object
The repository pull request merge strategies for the context repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"commitMessageTemplate": {
"body": "Merge in ${toProjectKey}/${toRepoSlug} from ${crossRepoProjectRepo}${fromRefName} to ${toRefName}",
"title": "Pull request #${id}: ${title}"
},
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"strategies": [
{
"id": "no-ff",
"links": {}
}
]
}
}'
Retrieve a page of pull requests in the current repository that contain the given commit. The user must be authenticated and have access to the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requirednumber
number
Return a page of pull requests in the current repository containing the given commit.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve a page of participant users for all the pull requests to or from the specified repository. Optionally clients can specify following filters.
string
Requiredstring
Requiredstring
string
string
number
number
A page of users that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve a page of pull requests to or from the specified repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource. Optionally clients can specify PR participant filters. Each filter has a mandatory username.N parameter, and the optional role.N and approved.N parameters.
string
Requiredstring
Requiredstring
string
string
string
string
string
string
string
number
number
A page of pull requests that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \
--header 'Accept: application/json;charset=UTF-8'
Create a new pull request from a source branch or tag to a target branch. The source and target may be in the same repository, or different ones. (Note that different repositories must belong to the same Repository#getHierarchyId()
hierarchy.)
The fromRef
may be a branch or a tag. The toRef
is required to be a branch. Tags are not allowed as targets because tags are intended to be immutable and should not be changed after they are created.
The authenticated user must have REPO_READ permission for the fromRef
and toRef
repositories to call this resource.
string
Requiredstring
RequiredThe pull request data
object
boolean
integer
integer
string
string
boolean
object
string
integer
The newly created pull 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"author": {
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
},
"closed": true,
"closedDate": 19990759200,
"createdDate": 13590759200,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"descriptionAsHtml": "<string>",
"draft": true,
"fromRef": {
"displayId": "feature-ABC-1233",
"id": "refs/heads/feature-ABC-123",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
},
"type": "BRANCH"
},
"htmlDescription": "<string>",
"id": 1,
"links": {},
"locked": true,
"open": true,
"participants": [
{
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
}
],
"reviewers": [
{
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
}
],
"state": "DECLINED",
"title": "Talking Nerdy",
"toRef": {
"displayId": "feature-ABC-1233",
"id": "refs/heads/feature-ABC-123",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
},
"type": "BRANCH"
},
"updatedDate": 14490759200,
"version": 2154
}'
Retrieve a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe specified pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Accept: application/json;charset=UTF-8'
Update the title, description, reviewers, destination branch or draft status of an existing pull request.
Note: the reviewers list may be updated using this resource. However the author and participants list may not.
The authenticated user must either:
to call this resource.
string
Requiredstring
Requiredstring
RequiredThe updated pull request
object
boolean
integer
integer
string
string
boolean
object
string
integer
The updated pull 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"author": {
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
},
"closed": true,
"closedDate": 19990759200,
"createdDate": 13590759200,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"descriptionAsHtml": "<string>",
"draft": true,
"fromRef": {
"displayId": "feature-ABC-1233",
"id": "refs/heads/feature-ABC-123",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
},
"type": "BRANCH"
},
"htmlDescription": "<string>",
"id": 1,
"links": {},
"locked": true,
"open": true,
"participants": [
{
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
}
],
"reviewers": [
{
"approved": true,
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "AUTHOR",
"status": "UNAPPROVED",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
}
],
"state": "DECLINED",
"title": "Talking Nerdy",
"toRef": {
"displayId": "feature-ABC-1233",
"id": "refs/heads/feature-ABC-123",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
},
"type": "BRANCH"
},
"updatedDate": 14490759200,
"version": 2154
}'
Deletes a pull request.
To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must:
A body containing the version of the pull request must be provided with this request.
{ "version": 1 }
string
Requiredstring
Requiredstring
RequiredA body containing the version of the pull request
integer
The pull request was deleted.
1
2
3
4
5
6
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Content-Type: application/json' \
--data '{
"version": 2154
}'
Streams the raw diff for a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
A raw diff for the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff' \
--header 'Accept: text/plain'
Streams a patch representing a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredA patch representing the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch' \
--header 'Accept: text/plain'
Retrieve a page of activity associated with a pull request.
Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more.
Different types of activity items may be introduced in newer versions of Stash or by user installed plugins, so clients should be flexible enough to handle unexpected entity shapes in the returned page.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of activity relating to the specified pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities' \
--header 'Accept: application/json;charset=UTF-8'
Returns an auto-merge request for the pull request, if requested.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe auto-merge request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/auto-merge' \
--header 'Accept: application/json;charset=UTF-8'
Requests the system to try merging the pull request if auto-merge was requested on it.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe result of trying to auto-merge the pull request.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/auto-merge' \
--header 'Accept: application/json;charset=UTF-8'
Cancels a request to auto-merge the pull request, if the pull request was not merged yet.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe auto-merge request was cancelled.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/auto-merge'
Gets comments matching the given set of field values for the specified pull request. (Note this does not perform any kind of searching for comments by their text).
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
array<string>
string
number
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments' \
--header 'Accept: application/json;charset=UTF-8'
Add a new blocker comment.
Comments can be added in a few places by setting different attributes:
General pull request blocker comment:
1 2 3 4
{ "text": "A task on a pull request." }
Blocker reply to a comment:
1 2 3 4 5 6 7
{ "text": "This reply is a task.", "parent": { "id": 1 } }
General blocker file comment:
1 2 3 4 5 6 7 8 9 10 11
{ "text": "A blocker comment on a file.", "anchor": { "diffType": "RANGE", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Blocker file line comment:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
{ "text": "A task on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on. For backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:
'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are:
If the current user is not a participant the user is added as a watcher of the pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe comment to add.
integer
object
string
string
string
boolean
integer
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
Retrieves a pull request comment.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \
--header 'Accept: application/json;charset=UTF-8'
Update a comment, with the following restrictions:
Convert a comment to a task or vice versa.
Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':
1 2 3 4 5
{ "severity": "BLOCKER" }
Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL': ```
{ "severity": "NORMAL" }
1 2 3 4 5 6 7 8
Resolve a blocker comment. Blocker comments can be resolved by setting the 'state' attribute to 'RESOLVED': ``` { "state": "RESOLVED" }
Note: the supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe comment to add.
integer
object
string
string
string
boolean
integer
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}'
Gets changes for the specified PullRequest.
If the changeScope query parameter is set to 'UNREVIEWED', the application will attempt to stream unreviewed changes based on the lastReviewedCommit of the current user, which are the changes between the lastReviewedCommit and the latest commit of the source branch. The current user is considered to not have any unreviewed changes for the pull request when the lastReviewedCommit is either null (everything is unreviewed, so all changes are streamed), equal to the latest commit of the source branch (everything is reviewed), or no longer on the source branch (the source branch has been rebased). In these cases, the application will fall back to streaming all changes (the default), which is the effective diff for the pull request. The type of changes streamed can be determined by the changeScope parameter included in the properties map of the response.
Note: This resource is currently not paged. The server will return at most one page. The server will truncate the number of changes to either the request's page limit or an internal maximum, whichever is smaller. The start parameter of the page request is also ignored.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
number
number
A page of unreviewed Changes for the current user from the supplied pull request, including the unreviewedCommits in the properties map.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes' \
--header 'Accept: application/json;charset=UTF-8'
Gets comments for the specified pull request and path.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
array<string>
string
array<string>
string
string
number
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments?path={path}' \
--header 'Accept: application/json;charset=UTF-8'
Add a new comment.
Comments can be added in a few places by setting different attributes:
General pull request comment:{ "text": "An insightful general comment on a pull request." }Reply to a comment:
{General file comment:"text": "A measured reply.", "parent": { "id": 1 } }
{ "text": "An insightful general comment on a file.", "anchor": { "diffType": "RANGE", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }File line comment:
{ "text": "A pithy comment on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Add a new task.
Tasks are just comments with the attribute 'severity' set to 'BLOCKER':
General pull request task:
{ "text": "A task on a pull request.", "severity": "BLOCKER" }
Add a pending comment.
Pending comments are just comments with the attribute 'state' set to 'PENDING':
Pending comment:
{ "text": "This is a pending comment", "state": "PENDING" }
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves).
fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added.
For diffType 'COMMIT' or 'RANGE', you must specify both the fromHash and toHash. Note that this behaviour differs from /commits/comments
Finally diffType refers to the type of diff the comment was added on. For backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe comment to add
integer
object
string
string
string
boolean
integer
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
Retrieves a pull request comment.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}' \
--header 'Accept: application/json;charset=UTF-8'
Update a comment, with the following restrictions:
Convert a comment to a task or vice versa.
Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':
{ "severity": "BLOCKER" }
Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL':
{ "severity": "NORMAL" }
Resolve a task.
Tasks can be resolved by setting the 'state' attribute to 'RESOLVED':
{ "state": "RESOLVED" }
Note: the supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe updated comment
integer
object
string
string
string
boolean
integer
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}'
Apply a suggestion contained within a comment.
string
Requiredstring
Requiredstring
Requiredstring
RequiredA request containing other parameters required to apply a suggestion - The given versions/hashes must match the server's version/hashes or the suggestion application will fail (in order to avoid applying the suggestion to the wrong place
integer
string
integer
integer
An empty response indicating the suggestion has been applied.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestion' \
--header 'Content-Type: application/json' \
--data '{
"commentVersion": 0,
"commitMessage": "A commit message",
"pullRequestVersion": 1,
"suggestionIndex": 2
}'
Retrieve a suggested commit message for the given Pull Request.
string
Requiredstring
Requiredstring
RequiredThe suggested commit message
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commit-message-suggestion' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve commits for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
number
number
A page of commits from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits' \
--header 'Accept: application/json;charset=UTF-8'
Decline a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Optional body
string
integer
The pull request was declined.
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"comment": "An optional comment explaining why the pull request is being declined",
"version": 2154
}'
Retrieve the diff stats summary for the given Pull Request.
The stats summary include the total number of modified files, added lines, and deleted lines.
Note: The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
The diff stats summary
RestDiffStatsSummary
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff-stats-summary/{path}' \
--header 'Accept: application/json;charset=UTF-8'
Streams a diff within a pull request.
If the specified file has been copied, moved or renamed, the srcPath
must also be specified to produce the correct diff.
To stream a raw text representation of the diff, this endpoint can be called with the request header 'Accept: text/plain'.
Note: This RESTful endpoint is currently not paged. The server will internally apply a hard cap to the streamed lines, and it is not possible to request subsequent pages if that cap is exceeded.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
string
string
string
string
A page of differences from a pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}' \
--header 'Accept: application/json;charset=UTF-8'
Test whether a pull request can be merged.
A pull request may not be merged if:
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe mergeability status of the pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \
--header 'Accept: application/json;charset=UTF-8'
Merge the specified pull request immediately or set the pull request to auto-merge when all the merge checks pass by setting autoMerge field in the request body.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
The body holder
boolean
string
string
string
integer
The merged pull request.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"autoMerge": false,
"autoSubject": "(Optional, 5.7+) true to prepend an auto-generated subject to the message (default), or false to use the message as-is",
"message": "(Optional) A descriptive message for the merge commit",
"strategyId": "(Optional) squash",
"version": 2154
}'
Returns the best common ancestor between the latest commits of the source and target branches of the pull request. If more than one best common ancestor exists, only one will be returned. It is unspecified which will be returned.
string
Requiredstring
Requiredstring
RequiredThe common ancestor of the latest commits in the source and target branches of this pull request
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge-base' \
--header 'Accept: application/json;charset=UTF-8'
Retrieves a page of the participants for a given pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requirednumber
number
Details of the participants in this pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \
--header 'Accept: application/json;charset=UTF-8'
Assigns a participant to an explicit role in pull request. Currently only the REVIEWER role may be assigned.
If the user is not yet a participant in the pull request, they are made one and assigned the supplied role.
If the user is already a participant in the pull request, their previous role is replaced with the supplied role unless they are already assigned the AUTHOR role which cannot be changed and will result in a Bad Request (400) response code.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe participant to be added to the pull request, includes the user and their role
string
object
Details of the participants in this pull request.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"role": "AUTHOR",
"user": {
"active": true,
"avatarUrl": "<string>",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"links": {},
"name": "jcitizen",
"slug": "jcitizen",
"type": "NORMAL"
}
}'
Change the current user's status for a pull request. Implicitly adds the user as a participant if they are not already. If the current user is the author, this method will fail.
The possible values for {@code status} are UNAPPROVED, NEEDS_WORK (which is referred to as "Requested changes" in the frontend from 8.10 onward), or APPROVED.
If the new {@code status} is NEEDS_WORK or APPROVED then the {@code lastReviewedCommit} for the participant will be updated to the latest commit of the source branch of the pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The participant representing the status to set, includes the status of the participant and last reviewed commit. If last reviewed commit is provided, it will be used to update the participant status. The operation will fail if the latest commit of the pull request does not match the provided last reviewed commit. If last reviewed commit is not provided, the latest commit of the pull request will be used for the update by default.
string
string
Details of the new participant.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"lastReviewedCommit": "685cac2c4499ff1f308851e35d2b4357844d8927",
"status": "UNAPPROVED"
}'
Unassigns a participant from the REVIEWER role they may have been given in a pull request.
If the participant has no explicit role this method has no effect.
Afterwards, the user will still remain a participant in the pull request but their role will be reduced to PARTICIPANT. This is because once made a participant of a pull request, a user will forever remain a participant. Only their role may be altered.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe update completed.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}'
Re-open a declined pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
The body holder
integer
The merged pull request.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"version": 2154
}'
Get the CommentThread
threads which have Comment
comments that have a CommentState#PENDING
pending state and are part of the pull request review for the authenticated user.
string
Requiredstring
Requiredstring
Requirednumber
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \
--header 'Accept: application/json;charset=UTF-8'
Complete a review on a pull request.
string
Requiredstring
Requiredstring
Requiredstring
The REST request which contains comment text, last reviewed commit and participant status. If last reviewed commit is provided, it will be used to update the participant status. The operation will fail if the latest commit of the pull request does not match the provided last reviewed commit. If last reviewed commit is not provided, the latest commit of the pull request will be used for the update by default.
string
string
string
Getting back the number of published comments and completing the review on a pull request.
any
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"commentText": "General comment text",
"lastReviewedCommit": "685cac2c4499ff1f308851e35d2b4357844d8927",
"participantStatus": "approved"
}'
Discard a pull request review for the authenticated user.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe pull request review has been discarded.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review'
Add the authenticated user as a watcher for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is now watching the pull request.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
Remove the authenticated user as a watcher for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is no longer watching the pull request.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
Retrieve a page of reviewer groups of a given scope.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requirednumber
number
A page
of reviewer group(s) of the provided scope and its inherited scope.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \
--header 'Accept: application/json;charset=UTF-8'
Create a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe request containing the details of the reviewer group.
string
string
integer
string
object
array<ApplicationUser>
The newly created reviewer group.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}'
Retrieve a reviewer group.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe reviewer group.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json;charset=UTF-8'
Update the attributes of a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.
string
string
integer
string
object
array<ApplicationUser>
The updated reviewer group.
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
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}'
Deletes a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}'
Retrieve a list of the users of a reviewer group.
This does not return all the users of the group, only the users who are licensed and have REPO_READ permission for the specified repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe list of users of a reviewer group.
array<RestApplicationUser>
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/users' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve a page of reviewer groups of a given scope.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requirednumber
number
A page of reviewer group(s) of the provided scope.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \
--header 'Accept: application/json;charset=UTF-8'
Create a reviewer group.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredThe reviewer group to be create
string
string
integer
string
object
array<ApplicationUser>
The newly created reviewer group.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}'
Retrieve a reviewer group.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredThe reviewer group.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json;charset=UTF-8'
Update the attributes of a reviewer group.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredThe request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.
string
string
integer
string
object
array<ApplicationUser>
A page of changes.
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
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"description": "null",
"id": 2154,
"name": "name",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"active": true,
"displayName": "<string>",
"emailAddress": "<string>",
"id": 2154,
"name": "<string>",
"slug": "<string>",
"type": "NORMAL"
}
]
}'
Deletes a reviewer group.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}'
Rate this page: