Server
Bitbucket Data Center / / Modules

Pull Requests

Postman Collection
OpenAPI
Operations
POST/default-reviewers/latest/projects/{projectKey}/conditionPUT/default-reviewers/latest/projects/{projectKey}/condition/{id}DEL/default-reviewers/latest/projects/{projectKey}/condition/{id}GET/default-reviewers/latest/projects/{projectKey}/conditionsPOST/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditionPUT/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}DEL/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}GET/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditionsGET/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewersGET/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebasePOST/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebasePUT/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}DEL/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}GET/api/latest/admin/pull-requests/{scmId}POST/api/latest/admin/pull-requests/{scmId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requestsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/participantsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requestsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requestsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activitiesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-commentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-commentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestionGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commitsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/declineGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/mergePOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/mergeGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participantsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participantsPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopenGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watchDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groupsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groupsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/usersGET/api/latest/projects/{projectKey}/settings/reviewer-groupsPOST/api/latest/projects/{projectKey}/settings/reviewer-groupsGET/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}PUT/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}DEL/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
POST

Create default reviewer

Create a default reviewer pull request condition for the given project.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The details needed to create a default reviewer pull request condition.

requiredApprovals

integer

reviewers

array<RestApplicationUser>

sourceMatcher

object

targetMatcher

object

Responses

The default reviewer pull request condition that was created.

application/json

RestPullRequestCondition
POST/default-reviewers/latest/projects/{projectKey}/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 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, "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } ], "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" } } }'
200Response
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 { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 }
PUT

Update the default reviewer

Update the default reviewer pull request condition for the given ID.

Request

Path parameters

projectKey

string

Required
id

string

Required

Request bodyapplication/json

The new details for the default reviewer pull request condition.

requiredApprovals

integer

reviewers

array<RestApplicationUser>

sourceMatcher

object

targetMatcher

object

Responses

The updated default reviewer pull request condition.

application/json

RestPullRequestCondition
PUT/default-reviewers/latest/projects/{projectKey}/condition/{id}
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 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, "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } ], "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" } } }'
200Response
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 { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 }
DEL

Remove default reviewer

Delete the default reviewer pull request condition associated with the given ID.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

An empty response indicating that the pull request condition was deleted.

DEL/default-reviewers/latest/projects/{projectKey}/condition/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/condition/{id}'
GET

Get default reviewers

Return a page of default reviewer pull request conditions that have been configured for this project.

Request

Path parameters

projectKey

string

Required

Responses

The default reviewer pull request conditions associated with the given project.

application/json

array<RestPullRequestCondition>

GET/default-reviewers/latest/projects/{projectKey}/conditions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/conditions' \ --header 'Accept: application/json'
200Response
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 [ { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 } ]
POST

Create default reviewers condition

Create a default reviewer pull request condition for the given repository.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The details needed to create a default reviewer pull request condition.

requiredApprovals

integer

reviewers

array<RestApplicationUser>

sourceMatcher

object

targetMatcher

object

Responses

The default reviewer pull request condition that was created.

application/json

RestPullRequestCondition
POST/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/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 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, "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } ], "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" } } }'
200Response
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 { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 }
PUT

Update a default reviewer condition

Update the default reviewer pull request condition for the given ID.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Request bodyapplication/json

requiredApprovals

integer

reviewers

array<RestApplicationUser>

sourceMatcher

object

targetMatcher

object

Responses

The updated default reviewer pull request condition.

application/json

RestPullRequestCondition
PUT/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}
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 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, "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } ], "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" } } }'
200Response
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 { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 }
DEL

Delete a default reviewer condition

Delete the default reviewer pull request condition associated with the given ID.

Request

Path parameters

projectKey

string

Required
id

integer

Required
repositorySlug

string

Required

Responses

An empty response indicating that the pull request condition was deleted

DEL/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}'
GET

Get configured default reviewers

Return a page of default reviewer pull request conditions that have been configured for this repository.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The default reviewer pull request conditions associated with the given repository.

application/json

array<RestPullRequestCondition>

GET/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions' \ --header 'Accept: application/json'
200Response
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 [ { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 } ]
GET

Get required reviewers for PR creation

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

targetRepoId

string

sourceRepoId

string

sourceRefId

string

targetRefId

string

Responses

The default reviewer pull request conditions associated with the given repository.

application/json

array<RestPullRequestCondition>

GET/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewers
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewers' \ --header 'Accept: application/json'
200Response
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 [ { "reviewers": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "requiredApprovals": 1, "targetRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "sourceRefMatcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "id": 1 } ]
GET

Check PR rebase precondition

Checks preconditions to determine whether the pull request can be rebased.

Some of the preconditions are:

  • The pull request is between Git repositories
  • The pull request is currently open
  • The pull request's {@link PullRequest#getFromRef "from" ref} is a branch
    • In other words, the qualified ID for the "from" ref must start with refs/heads/
    • Tags, and other non-standard refs, cannot be rebased
  • The current user has an e-mail address
    • Pull requests cannot be rebased anonymously
    • git rebase records the current user as the committer for the rebased commits, which requires a name and e-mail address
  • The current user has write access to the {@link PullRequest#getFromRef "from" ref}'s repository
    • Note that in order to view a pull request a user is only required to have read access to the {@link PullRequest#getToRef toRef}'s repository, so just because a user can see a pull request does not mean they can request a rebase

This 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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The rebaseability status of the pull request.

application/json

RestPullRequestRebaseability
GET/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "vetoes": [ { "detailedMessage": "You have insufficient permissions to rebase 'refs/heads/feature-branch'.", "summaryMessage": "Insufficient branch permissions" } ] }
POST

Rebase pull request

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The pull request rebase request.

version

integer

Responses

The merged pull request.

application/json

RestPullRequestRebaseResult
POST/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase
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' \ --header 'Content-Type: application/json' \ --data '{ "version": 1 }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "refChange": { "fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad", "toHash": "d6edcbf924697ab811a867421dab60d954ccad99", "refId": "refs/heads/master", "type": "ADD", "ref": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" } } }
PUT

React to a PR comment

Add an emoticon reaction to a pull request comment

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
emoticon

string

Required
repositorySlug

string

Required

Responses

The added reaction

application/json

RestUserReaction
PUT/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 { "emoticon": { "shortcut": "<string>", "url": "<string>", "value": "<string>" }, "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "comment": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [ { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } ], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } }
DEL

Remove a reaction from a PR comment

Remove an emoticon reaction from a pull request comment

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
emoticon

string

Required
repositorySlug

string

Required

Responses

The added reaction

DEL/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}'
GET

Get merge strategies

Retrieve the merge strategies available for this instance. The user must be authenticated to call this resource.

Request

Path parameters

scmId

string

Required

Responses

The merge configuration of this instance.

application/json

RestPullRequestMergeConfig
GET/api/latest/admin/pull-requests/{scmId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "defaultStrategy": { "description": "Always create a merge commit", "flag": "--no-ff", "enabled": true, "name": "Merge commit", "id": "no-ff" }, "commitSummaries": 2154, "strategies": [ { "description": "Always create a merge commit", "flag": "--no-ff", "enabled": true, "name": "Merge commit", "id": "no-ff" } ], "type": "repository" }
POST

Update merge strategies

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

An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:```{ "mergeConfig": { } }

1 2 Upon completion of this request, the effective configuration will be the default configuration.

Request

Path parameters

scmId

string

Required

Request bodyapplication/json

the settings

mergeConfig

object

Responses

The repository pull request merge strategies for the context repository.

application/json

RestPullRequestMergeConfig
POST/api/latest/admin/pull-requests/{scmId}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "mergeConfig": { "defaultStrategy": { "id": "no-ff", "links": {} }, "commitSummaries": 2154, "strategies": [ { "id": "no-ff", "links": {} } ] } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "defaultStrategy": { "description": "Always create a merge commit", "flag": "--no-ff", "enabled": true, "name": "Merge commit", "id": "no-ff" }, "commitSummaries": 2154, "strategies": [ { "description": "Always create a merge commit", "flag": "--no-ff", "enabled": true, "name": "Merge commit", "id": "no-ff" } ], "type": "repository" }
GET

Get repository pull requests containing commit

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

Return a page of pull requests in the current repository containing the given commit.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests' \ --header 'Accept: application/json'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 { "values": [ { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Search pull request participants

Retrieve a page of participant users for all the pull requests to or from the specified repository. Optionally clients can specify following filters.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

role

string

direction

string

start

number

limit

number

Responses

A page of users that match the search criteria.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get pull requests for repository

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.

  • username.N - the "root" of a single participant filter, where "N" is a natural number starting from 1. This allows clients to specify multiple participant filters, by providing consecutive filters as username.1, username.2 etc. Note that the filters numbering has to start with 1 and be continuous for all filters to be processed. The total allowed number of participant filters is 10 and all filters exceeding that limit will be dropped.
  • role.N(optional) the role associated with username.N. This must be one of AUTHOR, REVIEWER, or PARTICIPANT
  • approved.N (optional) the approved status associated with username.N. That is whether username.N has approved the PR. Either true, or false

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

withAttributes

string

at

string

withProperties

string

filterText

string

state

string

order

string

direction

string

start

number

limit

number

Responses

A page of pull requests that match the search criteria.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \ --header 'Accept: application/json'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 { "values": [ { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Create pull request

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The pull request data

closedDate

integer

participants

array<RestPullRequestParticipant>

reviewers

array<RestPullRequestParticipant>

htmlDescription

string

createdDate

integer

updatedDate

integer

description

string

fromRef

object

toRef

object

title

string

Responses

The newly created pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests
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 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } } ], "htmlDescription": "<string>", "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "scmId": "git", "slug": "my-repo", "project": { "avatarUrl": "<string>", "avatar": "<string>", "key": "PRJ", "links": {} }, "name": "My repo", "links": {} }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "scmId": "git", "slug": "my-repo", "project": { "avatarUrl": "<string>", "avatar": "<string>", "key": "PRJ", "links": {} }, "name": "My repo", "links": {} }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "links": {} }'
201Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
GET

Get pull request

Retrieve a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The specified pull request.

application/json

RestPullRequest
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \ --header 'Accept: application/json'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
PUT

Update pull request metadata

Update the title, description, reviewers or destination branch 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:

  • be the author of the pull request and have the REPO_READ permission for the repository that this pull request targets; or
  • have the REPO_WRITE permission for the repository that this pull request targets

to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated pull request

closedDate

integer

participants

array<RestPullRequestParticipant>

reviewers

array<RestPullRequestParticipant>

htmlDescription

string

createdDate

integer

updatedDate

integer

description

string

fromRef

object

toRef

object

title

string

Responses

The updated pull request.

application/json

RestPullRequest
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
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 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "links": {}, "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "avatarUrl": "<string>" } } ], "htmlDescription": "<string>", "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "scmId": "git", "slug": "my-repo", "project": { "avatarUrl": "<string>", "avatar": "<string>", "key": "PRJ", "links": {} }, "name": "My repo", "links": {} }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "scmId": "git", "slug": "my-repo", "project": { "avatarUrl": "<string>", "avatar": "<string>", "key": "PRJ", "links": {} }, "name": "My repo", "links": {} }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "links": {} }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
DEL

Delete pull request

Deletes a pull request.

To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must:

  • be the pull request author, if the system is configured to allow authors to delete their own pull requests (this is the default) OR
  • have repository administrator permission for the repository the pull request is targeting

A body containing the version of the pull request must be provided with this request.

{ "version": 1 }

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

A body containing the version of the pull request

version

integer

Responses

The pull request was deleted.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
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 }'
GET

Stream raw pull request diff

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

whitespace

string

Responses

A raw diff for the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff' \ --header 'Accept: application/json'
GET

Stream pull request as patch

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

A patch representing the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch' \ --header 'Accept: application/json'
GET

Get pull request activity

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

fromType

string

fromId

string

start

number

limit

number

Responses

A page of activity relating to the specified pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "action": "APPROVED", "createdDate": 19990759200, "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "id": 1 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Search pull request comments

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

count

string

state

array<string>

states

string

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 { "values": [ { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Add new blocker comment

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:

  • 'ADDED' - for an added line;
  • 'REMOVED' - for a removed line; or
  • 'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.

'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:

  • 'FROM' - the source file of the diff
  • 'TO' - the destination file of the diff

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add.

threadResolved

boolean

text

string

severity

string

version

integer

id

integer

state

string

properties

object

Responses

The newly created comment.

application/json

RestComment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments
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' \ --header 'Content-Type: application/json' \ --data '{ "threadResolved": true, "text": "An insightful comment.", "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }'
201Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
GET

Get pull request comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The requested comment.

application/json

RestComment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
PUT

Update pull request comment

Update a comment, with the following restrictions:

  • only the author of the comment may update the text of the comment
  • only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add.

threadResolved

boolean

text

string

severity

string

version

integer

id

integer

state

string

properties

object

Responses

The newly updated comment.

application/json

RestComment
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
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' \ --header 'Content-Type: application/json' \ --data '{ "threadResolved": true, "text": "An insightful comment.", "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
DEL

Delete pull request comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}'
GET

Gets pull request changes

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

sinceId

string

changeScope

string

untilId

string

withComments

string

start

number

limit

number

Responses

A page of unreviewed Changes for the current user from the supplied pull request, including the unreviewedCommits in the properties map.

application/json

RestChange
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes' \ --header 'Accept: application/json'
200Response
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 { "conflict": { "ourChange": { "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "type": "ADD", "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "theirChange": { "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "type": "ADD", "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } } }, "contentId": "abcdef0123abcdef4567abcdef8987abcdef6543", "fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a", "percentUnchanged": 98, "srcExecutable": true, "executable": true, "nodeType": "DIRECTORY", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "type": "ADD", "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }
GET

Get pull request comments for path

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

path

string

Required
fromHash

string

anchorState

string

diffType

array<string>

toHash

string

state

array<string>

diffTypes

string

states

string

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 { "values": [ { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Add pull request comment

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:
 { 

"text": "A measured reply.", "parent": { "id": 1 } }

General file comment:
 {
"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). 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:

  • 'ADDED' - for an added line;
  • 'REMOVED' - for a removed line; or
  • 'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.
'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:
  • 'FROM' - the source file of the diff
  • 'TO' - the destination file of the diff
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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add

threadResolved

boolean

text

string

severity

string

version

integer

id

integer

state

string

properties

object

Responses

The newly created comment.

application/json

RestComment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments
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' \ --header 'Content-Type: application/json' \ --data '{ "threadResolved": true, "text": "An insightful comment.", "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }'
201Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
GET

Get a pull request comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The requested comment.

application/json

RestComment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
PUT

Update pull request comment

Update a comment, with the following restrictions:

  • only the author of the comment may update the text of the comment
  • only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated comment

threadResolved

boolean

text

string

severity

string

version

integer

id

integer

state

string

properties

object

Responses

The newly updated comment.

application/json

RestComment
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
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' \ --header 'Content-Type: application/json' \ --data '{ "threadResolved": true, "text": "An insightful comment.", "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} }
DEL

Delete a pull request comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}'
POST

Apply pull request suggestion

Apply a suggestion contained within a comment.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

A 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

commentVersion

object

commitMessage

string

pullRequestVersion

object

suggestionIndex

object

Responses

An empty response indicating the suggestion has been applied.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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": { "asInt": 2154, "present": true }, "commitMessage": "A commit message", "pullRequestVersion": { "asInt": 2154, "present": true }, "suggestionIndex": { "asInt": 2154, "present": true } }'
GET

Get pull request commits

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

avatarScheme

string

withCounts

string

avatarSize

string

start

number

limit

number

Responses

A page of commits from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "message": "More work on feature 1", "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Decline pull request

Decline a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

comment

string

version

integer

Responses

The pull request was declined.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline
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' \ --header 'Content-Type: application/json' \ --data '{ "comment": "An optional comment explaining why the pull request is being declined", "version": 2154 }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} diff

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

integer

sinceId

string

srcPath

string

diffType

string

untilId

string

whitespace

string

withComments

boolean

Responses

A raw diff for the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff' \ --header 'Accept: application/json'
GET

Stream a diff within a pull request

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.

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.

Request

Path parameters

pullRequestId

string

Required
repositorySlug

string

Required
path

string

Required
projectKey

string

Required

Query parameters

sinceId

string

srcPath

string

diffType

string

avatarSize

string

avatarScheme

string

contextLines

string

untilId

string

whitespace

string

withComments

string

start

number

Responses

A page of differences from a pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}
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'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 { "values": [ { "truncated": true, "lineComments": [ { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ {} ], "reviewers": [ {} ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ {} ], "reviewers": [ {} ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } ], "destination": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "hunks": [ { "truncated": true, "sourceLine": 2154, "sourceSpan": 2154, "destinationLine": 2154, "destinationSpan": 2154, "segments": [ {} ], "context": "<string>" } ], "binary": true, "source": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Test if pull request can be merged

Test whether a pull request can be merged.

A pull request may not be merged if:

  • there are conflicts that need to be manually resolved before merging; and/or
  • one or more merge checks have vetoed the merge.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The mergeability status of the pull request.

application/json

RestPullRequestMergeability
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "conflicted": true, "outcome": "CLEAN", "vetoes": [ { "detailedMessage": "You have insufficient permissions to rebase 'refs/heads/feature-branch'.", "summaryMessage": "Insufficient branch permissions" } ] }
POST

Merge pull request

Merge the specified pull request.

The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

autoSubject

string

context

object

message

string

strategyId

string

version

integer

Responses

The merged pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge
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' \ --header 'Content-Type: application/json' \ --data '{ "autoSubject": "(Optional, 5.7+) true to prepend an auto-generated subject to the message (default), or false to use the message as-is", "context": {}, "message": "(Optional) A descriptive message for the merge commit", "strategyId": "(Optional) squash", "version": 2154 }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
GET

Get pull request participants

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

Details of the participants in this pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "values": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Assign pull request participant role

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The participant to be added to the pull request, includes the user and their role

role

string

user

object

Responses

Details of the participants in this pull request.

application/json

RestPullRequestParticipant
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants
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' \ --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" } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } }
PUT

Change pull request status

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, 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.

Request

Path parameters

projectKey

string

Required
userSlug

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The participant representing the status to set, includes the status of the participant

status

string

Responses

Details of the new participant.

application/json

RestPullRequestParticipant
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}
1 2 3 4 5 6 7 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "status": "UNAPPROVED" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } }
DEL

Unassign pull request participant

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.

Request

Path parameters

projectKey

string

Required
userSlug

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The update completed.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}'
POST

Re-open pull request

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

version

integer

Responses

The merged pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen
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' \ --header 'Content-Type: application/json' \ --data '{ "version": 2154 }'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }
GET

Get pull request comment thread

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \ --header 'Accept: application/json'
200Response
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 { "values": [ { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "comments": [], "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "parent": { "threadResolved": true, "createdDate": 1359075920, "updatedDate": 1449075920, "author": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "html": "<string>", "anchored": true, "pending": true, "reply": true, "text": "An insightful comment.", "anchor": { "lineComment": true, "pullRequest": { "closedDate": 19990759200, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "status": "UNAPPROVED", "role": "AUTHOR", "user": { "emailAddress": "jane@example.com", "slug": "jcitizen", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "createdDate": 13590759200, "updatedDate": 14490759200, "description": "It is a kludge, but put the tuple from the database in the cache.", "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "relatedLinks": {}, "defaultBranch": "main", "description": "My repo description", "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "namespace": "<string>", "description": "The description for my cool project", "avatar": "<string>", "scope": "PROJECT", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scope": "REPOSITORY", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "id": "refs/heads/feature-ABC-123", "type": "BRANCH" }, "title": "Talking Nerdy", "closed": true, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true }, "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "diffType": "COMMIT", "fileType": "FROM", "srcPath": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "line": 98, "path": { "components": [ "path", "to", "file.txt" ], "extension": "txt", "name": "file.txt", "parent": "path/to" } }, "severity": "NORMAL", "version": 1, "id": 1, "state": "OPEN", "properties": {} }, "id": 1, "state": "OPEN", "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Complete pull request review

Complete a review on a pull request.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The REST request which contains comment text and participant status

commentText

string

participantStatus

string

Responses

Getting back the number of published comments and completing the review on a pull request.

application/json

any

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "commentText": "General comment text", "participantStatus": "approved" }'
DEL

Discard pull request review

Discard a pull request review for the authenticated user.

The authenticated user must have REPO_READ permission for the repository to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The pull request review has been discarded.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review'
POST

Watch pull request

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The user is now watching the pull request.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
DEL

Stop watching pull request

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.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The user is no longer watching the pull request.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
GET

Get all reviewer groups

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of reviewer group(s) of the provided scope and its inherited scope.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Create reviewer group

Create a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the details of the reviewer group.

avatarUrl

string

description

string

users

array<ApplicationUser>

scope

object

name

string

id

integer

Responses

The newly created reviewer group.

application/json

RestReviewerGroup
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups
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' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
GET

Get reviewer group

Retrieve a reviewer group.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The reviewer group.

application/json

RestReviewerGroup
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
PUT

Update reviewer group attributes

Update the attributes of a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.

avatarUrl

string

description

string

users

array<ApplicationUser>

scope

object

name

string

id

integer

Responses

The updated reviewer group.

application/json

RestReviewerGroup
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
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' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
DEL

Delete reviewer group

Deletes a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The operation was successful

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}'
GET

Get reviewer group users

Retrieve a list of the users of a reviewer group.

This does not return all the users of the group, only the users who have REPO_READ permission for the specified repository.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The list of users of a reviewer group.

application/json;charset=UTF-8

array<RestApplicationUser>

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/users
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'
GET

Get all reviewer groups

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.

Request

Path parameters

projectKey

string

Required

Query parameters

start

number

limit

number

Responses

A page of reviewer group(s) of the provided scope.

application/json

object
GET/api/latest/projects/{projectKey}/settings/reviewer-groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Create reviewer group

Create a reviewer group.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The reviewer group to be create

avatarUrl

string

description

string

users

array<ApplicationUser>

scope

object

name

string

id

integer

Responses

The newly created reviewer group.

application/json

RestReviewerGroup
POST/api/latest/projects/{projectKey}/settings/reviewer-groups
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' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
GET

Get reviewer group

Retrieve a reviewer group.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

The reviewer group.

application/json

RestReviewerGroup
GET/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
PUT

Update reviewer group attributes

Update the attributes of a reviewer group.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Request bodyapplication/json

The request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.

avatarUrl

string

description

string

users

array<ApplicationUser>

scope

object

name

string

id

integer

Responses

A page of changes.

application/json

RestReviewerGroup
PUT/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
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' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "description": "null", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "scope": { "resourceId": 2, "type": "GLOBAL" }, "name": "name", "id": 2154 }
DEL

Delete reviewer group

Deletes a reviewer group.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}'

Rate this page: