Skip to content

Merge Request Discussion

To interact with merge request discussions, the noteService object is defined.

The merge request discussion entity contains the following data:

class Note {...}
Name Data Type Description
id string Discussion UUID
mergeRequestId string Merge request UUID
discussionId string Updated discussion UUID
baseCommit string Last commit of the target branch of the merge request
targetCommit string Last commit of the target branch of the merge request
startCommit string Last commit of the source branch of the merge request
newLine number New line number for which the discussion is created
oldLine number Old line number for which the discussion is created
newPath string New file path for which the discussion is created
oldPath string Old file path for which the discussion is created
resolvable boolean Can the discussion be resolved: true or not: false
resolved boolean Discussion is resolved: true or open: false
type string Discussion type. The field always has the value MERGE_REQUEST_COMMENT
message string Discussion content
authorId string Discussion author UUID
diff string Changes to which the discussion was made
highlightLanguage string Programming language for code highlighting

Methods for Working with Merge Request Discussions

The following methods exist for working with the merge request discussion entity:

Creating a Merge Request Discussion

noteService.create(toCreate: Note) => Note

This method creates a discussion for a merge request and returns it. You need to provide the following values:

Name Data Type Description
mergeRequestId string Merge request UUID
message string Discussion content
resolved boolean Discussion is resolved: true or open: false
highlightLanguage string Programming language for code highlighting

Editing a Merge Request Discussion

noteService.edit(toEdit: Note) => Note

This method edits a discussion for a merge request and returns it. You need to provide the following values:

Name Data Type Description
noteId string Discussion UUID
message string Discussion content
resolved boolean Discussion is resolved: true or open: false
highlightLanguage string Programming language for code highlighting

Replying in a Merge Request Discussion

noteService.reply({noteId}, {message}) => Note

This method creates a reply in a discussion for a merge request and returns it. You need to provide the following values:

Name Data Type Description
noteId string Discussion UUID
message string Reply content in the discussion

Resolving a Merge Request Discussion

noteService.resolve({noteId}) => void

This method resolves a discussion for a merge request. You need to provide the following values:

Name Data Type Description
noteId string Discussion UUID

Unresolving a Merge Request Discussion

noteService.unresolve({noteId}) => void

This method reopens a discussion for a merge request. You need to provide the following values:

Name Data Type Description
noteId string Discussion UUID

Getting a List of All Discussions in a Merge Request

noteService.findAllInMergeRequest({mergeRequestId}, {startPage}, {pageSize}) => Page<Note>

This method returns an object with all discussions for a specified merge request. You need to provide the following values:

Name Data Type Description
mergeRequestId string Merge request UUID to search in
startPage number Requested page number
pageSize number Page size

Getting a Merge Request Discussion by UUID

noteService.findById({noteId}) => Note

This method returns the discussion for a merge request by the specified UUID. You need to provide the following values:

Name Data Type Description
noteId string Discussion UUID

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.