Merge Request Discussions
JSON Object Structure for Merge Request Discussion
Field | Type | Description |
---|---|---|
discussionUuid |
String | UUID of the root (first in chain) discussion. Returns null if the discussion is root |
baseCommit |
String | Merge-base commit hash of the merge request |
targetCommit |
String | Commit hash that was last in the target branch when the discussion was created |
startCommit |
String | Commit hash that was last in the source branch when the discussion was created |
createdAt |
Date | Discussion creation date and time |
newLine |
Integer | Line number after changes. Returns null if discussion isn't line-specific or isn't root |
oldLine |
Integer | Line number before changes. Returns null if discussion isn't line-specific or isn't root |
initialNewLine |
Integer | Line number after changes. Returns null if discussion isn't line-specific |
newPath |
String | File path for the discussed line after changes. Returns null if discussion isn't line-specific |
oldPath |
String | File path for the discussed line before changes. Returns null if discussion isn't line-specific |
rawMessage |
String | Discussion text with formatting elements |
message |
String | Discussion text. Identical to rawMessage value |
resolved |
Boolean | Returns true if discussion was closed, false if open |
resolvable |
Deprecated | Always returns null |
mergeRequestUuid |
String | UUID of the merge request containing the discussion |
type |
String | Discussion type. Possible value: MERGE_REQUEST_COMMENT |
author |
Object | User object describing the discussion creator |
uuid |
String | Discussion UUID |
formatedDate |
String | Time difference between current date and discussion creation date |
replies |
Array | Array of discussion replies. Returns objects with discussion fields. May return empty array if discussion isn't root or has no replies |
JSON Object Structure for User
Field | Type | Description |
---|---|---|
id |
String | User UUID |
username |
String | User alias |
name |
String | User first name |
surname |
String | User last name |
fullName |
String | User full name. Returns alias if first/last name not specified |
avatar |
String | User avatar URL |
cover |
String | User cover image URL |
Method to Get All Discussions
GET /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions
Returns an array of discussions for a merge request, with configurable pagination
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
Responses
STATUS 200
- Discussions list successfully returned.
Response example
{
"_embedded": {
"restDiscussionModelList": [
{
"rootNote": {
"discussionUuid": null,
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:00:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fix here",
"message": "Fix here",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": "b7741169-aaaa-aaaa-aaaa-88714b46c558",
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"formatedDate": "1 hour ago"
},
"replies": [
{
"discussionUuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:30:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fixed",
"message": "Fixed",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": null,
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "7cda0fdc-aaaa-aaaa-aaaa-6b0bfe8bbddf",
"username": "user",
"name": "Name",
"surname": "Surname",
"fullName": "Name Surname",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "5d2cf8af-aaaa-aaaa-aaaa-c212f287cd72",
"formatedDate": "30 minutes ago"
}
]
},
{
"rootNote": {
"discussionUuid": null,
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:40:00.00000Z",
"newLine": null,
"oldLine": null,
"initialNewLine": null,
"newPath": null,
"oldPath": null,
"rawMessage": "Resolve conflicts",
"message": "Resolve conflicts",
"resolved": false,
"resolvable": null,
"mergeRequestUuid": null,
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "a1ab0564-aaaa-aaaa-aaaa-8c3f107fb49f",
"formatedDate": "20 minutes ago"
},
"replies": []
}
]
},
"page": {
"size": 10,
"totalElements": 2,
"totalPages": 1,
"number": 0
}
}
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.
Method to Get Discussion by UUID
GET /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions/{discussionUuid}
Returns a discussion for a merge request, with configurable pagination
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
discussionUuid |
String | UUID of discussion to return |
Responses
STATUS 200
- Discussion successfully returned.
Response example
{
"discussionUuid": null,
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:00:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fix here",
"message": "Fix here",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": "b7741169-aaaa-aaaa-aaaa-88714b46c558",
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"formatedDate": "1 hour ago"
}
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.
Method to Create Discussion
POST /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions/create
Creates and returns a discussion for a merge request. Can create line-specific discussions. This method creates only new discussions. To reply to existing discussions, use this method
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
Request
Supported JSON format
POST request body structure:
JSON Variable | Type | Description |
---|---|---|
newLine |
Long | Optional. Line number after changes for line-specific discussion |
oldLine |
Long | Optional. Line number before changes for line-specific discussion |
newPath |
String | Optional. File path after changes for line-specific discussion |
oldPath |
String | Optional. File path before changes for line-specific discussion |
message |
String | Discussion message |
If any of
newLine
,oldLine
,newPath
oroldPath
fields are specified, all others must be provided for line-specific discussions.
JSON Object Example
{
"newLine": 10,
"oldLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"message": "Fix here"
}
Responses
STATUS 200
- Discussion successfully created and returned.
Response example
{
"discussionUuid": null,
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:00:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fix here",
"message": "Fix here",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": "b7741169-aaaa-aaaa-aaaa-88714b46c558",
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"formatedDate": "1 hour ago"
}
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.
STATUS 422
- Required field missing in request body
Method to Create Discussion Reply
POST /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions/reply
Creates and returns a reply to a discussion for a merge request. This method creates only replies to existing discussions. To create new discussions, use this method
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
Request
Supported JSON format
POST request body structure:
JSON Variable | Type | Description |
---|---|---|
discussionUuid |
String | UUID of discussion to reply to |
message |
String | Reply message |
If
discussionUuid
refers to a reply (non-root discussion), the new reply will automatically be attached to the root discussion of that reply.
JSON Object Example
{
"discussionUuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"message": "Fixed"
}
Responses
STATUS 200
- Discussion reply successfully created and returned.
Response example
{
"discussionUuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:00:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fixed",
"message": "Fixed",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": "b7741169-aaaa-aaaa-aaaa-88714b46c558",
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "5d2cf8af-aaaa-aaaa-aaaa-c212f287cd72",
"formatedDate": "1 hour ago"
}
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.
STATUS 422
- Required field missing in request body.
Method to Resolve Discussion
POST /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions/resolve/{discussionUuid}
Resolves a discussion for a merge request.
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
discussionUuid |
String | UUID of discussion to resolve |
If
discussionUuid
refers to a reply (non-root discussion), the root discussion of that reply will be resolved.
Responses
STATUS 200
- Discussion successfully resolved.
Response example
{
"discussionUuid": null,
"baseCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"targetCommit": "e07892271de5c4aaaaaaaaaaaa5d1913c453d45d",
"startCommit": "8ab2acb852f4beaaaaaaaaaaaa3b0f9cf1b4943c",
"createdAt": "2025-01-01T12:00:00.00000Z",
"newLine": 10,
"oldLine": 10,
"initialNewLine": 10,
"newPath": "README.md",
"oldPath": "README.md",
"rawMessage": "Fix here",
"message": "Fix here",
"resolved": true,
"resolvable": null,
"mergeRequestUuid": "b7741169-aaaa-aaaa-aaaa-88714b46c558",
"type": "MERGE_REQUEST_COMMENT",
"author": {
"id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
"username": "adminuser",
"name": "Admin user",
"surname": null,
"fullName": "Admin user",
"avatar": "https://gitflic.ru/static/image/avatar.jpg",
"cover": "https://gitflic.ru/static/image/user-cover.png"
},
"uuid": "a6bd97a8-aaaa-aaaa-aaaa-2729e030844f",
"formatedDate": "1 hour ago"
}
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.
Method to Delete Discussion
POST /project/{ownerAlias}/{projectAlias}/merge-request/{mergeRequestLocalId}/discussions/delete/{discussionUuid}
Deletes a discussion for a merge request.
Path Variable | Type | Description |
---|---|---|
ownerAlias |
String | Project owner alias |
projectAlias |
String | Project alias |
mergeRequestLocalId |
Long | Merge request ID |
discussionUuid |
String | UUID of discussion to delete |
If
discussionUuid
refers to a root discussion (first in thread), all discussions in that thread will be deleted.
Responses
STATUS 204
- Discussion successfully deleted.
STATUS 403
- Access denied.
STATUS 404
- Requested data not found.