Actions71
- Branch Actions
- File Actions
- Group Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Project Actions
- Raw API Actions
- Release Actions
- Tag Actions
Merge Request → Post Discussion Note
AI-generatedSummary
Post a note to a discussion thread in a GitLab merge request, either starting a new discussion or replying to an existing one, optionally attaching the note to specific file lines or commit positions.
Inputs
- Authentication — Select whether to use saved credentials or custom API fields for authenticating with your GitLab instance.
- GitLab Server — Base URL of your GitLab instance (only if using custom authentication). Defaults to https://gitlab.com.
- Access Token — Personal access token with API permissions (used if custom authentication is selected).
- Project Locator — Choose how to identify the project: by numeric ID or by owner and name path.
- Project ID — Numeric ID of the project (when using ID locator).
- Project Owner — Namespace or owner of the project (when using path locator).
- Project Name — Project slug or name (when using path locator).
- Merge Request IID (required) — Internal ID (IID) of the merge request to post the note on.
- Body — Text content of the note to post.
- Start New Discussion — Boolean to indicate whether to start a new discussion (true) or reply to an existing one (false). Defaults to false.
- Discussion ID (required) — ID of the existing discussion thread to reply to (required when replying, hidden if starting a new discussion).
- Position Type — Type of position for the note's placement, either 'text' or 'image'. Defaults to 'text'.
- New Path — File path in the new version of the file related to the note's position.
- Old Path — File path in the old version of the file related to the note's position.
- New Line — Line number in the new file version to which the note relates.
- Old Line — Line number in the old file version to which the note relates.
- Line Range Start Line Code — Line code for the start of a multi-line note range.
- Line Range Start Type — Type of the start line in the line range, 'new' or 'old'. Defaults to 'new'.
- Line Range Start Old Line — Old line number of the start line of the multiline note.
- Line Range Start New Line — New line number of the start line of the multiline note.
- Line Range End Line Code — Line code for the end of a multi-line note range.
- Line Range End Type — Type of the end line in the line range, 'new' or 'old'. Defaults to 'new'.
- Line Range End Old Line — Old line number of the end line of the multiline note.
- Line Range End New Line — New line number of the end line of the multiline note.
- Base SHA — Base commit SHA related to the note's position.
- Head SHA — Head commit SHA related to the note's position.
- Start SHA — Start commit SHA related to the note's position.
- Commit ID — Commit SHA referencing the commit where the discussion thread starts.
- Created At — Creation timestamp of the note in ISO 8601 format.
Output shape
a single JSON object representing the created discussion note.
Returns the GitLab API response for the newly created discussion note. The note can be a new discussion or a reply. All optional fields related to position and commit references affect the note's placement in the merge request's diff context.
Examples
Example 1: Post a new discussion note on a merge request identified by IID, with message text and no reply to existing discussion
Set Merge Request IID to the target MR ID, Body to the note text, and Start New Discussion to true.
Example 2: Reply to an existing discussion by posting a note to the discussion ID, with optional line position
Set Merge Request IID to the target MR ID, Discussion ID to the existing discussion, Body to the message, and Start New Discussion to false (default). Optionally fill position parameters to attach the note to a specific line.