gitlab-org--gitlab-foss/doc/user/project/quick_actions.md

18 KiB
Raw Blame History

type stage group info
reference Plan Project Management To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

GitLab Quick Actions

  • Introduced in GitLab 12.1: once an action is executed, an alert appears when a quick action is successfully applied.
  • Introduced in GitLab 13.2: you can use quick actions when updating the description of issues, epics, and merge requests.
  • Introduced in GitLab 13.8: when you enter / into a description or comment field, all available quick actions are displayed in a scrollable list.
  • The rebase quick action was introduced in GitLab 13.8.

Quick actions are textual shortcuts for common actions on issues, epics, merge requests, and commits that are usually done by clicking buttons or dropdowns in the GitLab UI. You can enter these commands in the description or in comments of issues, epics, merge requests, and commits. Each command should be on a separate line in order to be properly detected and executed.

Quick Actions for issues, merge requests and epics

The following quick actions are applicable to descriptions, discussions and threads in:

  • Issues
  • Merge requests
  • Epics (PREMIUM)
Command Issue Merge request Epic Action
/approve Approve the merge request. (STARTER)
/assign @user Assign one user.
/assign @user1 @user2 Assign multiple users. (STARTER)
/assign me Assign yourself.
/assign_reviewer @user or /reviewer @user or /request_review @user Assign one user as a reviewer.
/assign_reviewer @user1 @user2 or /reviewer @user1 @user2 or /request_review @user1 @user2 Assign multiple users as reviewers. (STARTER)
/assign_reviewer me or /reviewer me or /request_review me Assign yourself as a reviewer.
/award :emoji: Toggle emoji award.
/child_epic <epic> Add child epic to <epic>. The <epic> value should be in the format of &epic, group&epic, or a URL to an epic (introduced in GitLab 12.0). (ULTIMATE)
/clear_weight Clear weight. (STARTER)
/clone <path/to/project> [--with_notes] Clone the issue to given project, or the current one if no arguments are given (introduced in GitLab 13.7). Copies as much data as possible as long as the target project contains equivalent labels, milestones, and so on. Does not copy comments or system notes unless --with_notes is provided as an argument.
/close Close.
/confidential Make confidential.
/copy_metadata <!merge_request> Copy labels and milestone from another merge request in the project.
/copy_metadata <#issue> Copy labels and milestone from another issue in the project.
/create_merge_request <branch name> Create a new merge request starting from the current issue.
/done Mark to do as done.
/draft Toggle the draft status.
/due <date> Set due date. Examples of valid <date> include in 2 days, this Friday and December 31st.
/duplicate <#issue> Close this issue and mark as a duplicate of another issue. (FREE) Also, mark both as related. (STARTER)
/epic <epic> Add to epic <epic>. The <epic> value should be in the format of &epic, group&epic, or a URL to an epic. (PREMIUM)
/estimate <<W>w <DD>d <hh>h <mm>m> Set time estimate. For example, /estimate 1w 3d 2h 14m.
/invite_email email1 email2 Add up to 6 e-mail participants. This action is behind feature flag issue_email_participants
/iteration *iteration:"iteration name" Set iteration. For example, to set the Late in July iteration: /iteration *iteration:"Late in July" (introduced in GitLab 13.1). (STARTER)
/label ~label1 ~label2 Add one or more labels. Label names can also start without a tilde (~), but mixed syntax is not supported.
/lock Lock the discussions.
/merge Merge changes. Depending on the project setting, this may be when the pipeline succeeds, adding to a Merge Train, etc.
/milestone %milestone Set milestone.
/move <path/to/project> Move this issue to another project.
/parent_epic <epic> Set parent epic to <epic>. The <epic> value should be in the format of &epic, group&epic, or a URL to an epic (introduced in GitLab 12.1). (ULTIMATE)
/promote Promote issue to epic. (PREMIUM)
/publish Publish issue to an associated Status Page (Introduced in GitLab 13.0) (ULTIMATE)
/reassign @user1 @user2 Replace current assignees with those specified. (STARTER)
/rebase Rebase source branch. This schedules a background task that attempts to rebase the changes in the source branch on the latest commit of the target branch. If /rebase is used, /merge is ignored to avoid a race condition where the source branch is merged or deleted before it is rebased. If there are merge conflicts, GitLab displays a message that a rebase cannot be scheduled. Rebase failures are displayed with the merge request status.
/reassign_reviewer @user1 @user2 Replace current reviewers with those specified. (STARTER)
/relabel ~label1 ~label2 Replace current labels with those specified.
/relate #issue1 #issue2 Mark issues as related. (STARTER)
/remove_child_epic <epic> Remove child epic from <epic>. The <epic> value should be in the format of &epic, group&epic, or a URL to an epic (introduced in GitLab 12.0). (ULTIMATE)
/remove_due_date Remove due date.
/remove_epic Remove from epic. (PREMIUM)
/remove_estimate Remove time estimate.
/remove_iteration Remove iteration (introduced in GitLab 13.1) (STARTER)
/remove_milestone Remove milestone.
/remove_parent_epic Remove parent epic from epic (introduced in GitLab 12.1). (ULTIMATE)
/remove_time_spent Remove time spent.
/remove_zoom Remove Zoom meeting from this issue (introduced in GitLab 12.4).
/reopen Reopen.
/shrug <comment> Append the comment with ¯\_(ツ)_.
/spend <time(-<h>h <mm>m)> <date(<YYYY-MM-DD>)> Subtract spent time. Optionally, specify the date that time was spent on. For example, /spend time(-1h 30m) or /spend time(-1h 30m) date(2018-08-26).
/spend <time(<h>h <mm>m)> <date(<YYYY-MM-DD>)> Add spent time. Optionally, specify the date that time was spent on. For example, /spend time(1h 30m) or /spend time(1h 30m) date(2018-08-26).
/submit_review Submit a pending review (introduced in GitLab 12.7). (PREMIUM)
/subscribe Subscribe to notifications.
/tableflip <comment> Append the comment with (╯°□°)╯︵ ┻━┻.
/target_branch <local branch name> Set target branch.
/title <new title> Change title.
/todo Add a to-do item.
/unassign @user1 @user2 Remove specific assignees. (STARTER)
/unassign Remove all assignees.
/unassign_reviewer @user1 @user2 or /remove_reviewer @user1 @user2 Remove specific reviewers. (STARTER)
/unassign_reviewer or /remove_reviewer Remove all reviewers.
/unlabel ~label1 ~label2 or /remove_label ~label1 ~label2 Remove specified labels.
/unlabel or /remove_label Remove all labels.
/unlock Unlock the discussions.
/unsubscribe Unsubscribe from notifications.
/weight <value> Set weight. Valid options for <value> include 0, 1, 2, and so on. (STARTER)
/wip Toggle the draft status.
/zoom <Zoom URL> Add Zoom meeting to this issue (introduced in GitLab 12.4).

Autocomplete characters

Many quick actions require a parameter, for example: username, milestone, and label. Autocomplete characters can make it easier to enter a parameter, compared to selecting items from a list.

Quick actions parameters

The easiest way to set parameters for quick actions is to use autocomplete. If you manually enter a parameter, it must be enclosed in double quotation marks ("), unless it contains only these characters:

  1. ASCII letters.
  2. Numerals (0-9).
  3. Underscore (_), hyphen (-), question mark (?), dot (.), or ampersand (&).

Parameters are also case-sensitive. Autocomplete handles this, and the insertion of quotation marks, automatically.

Quick actions for commit messages

The following quick actions are applicable for commit messages:

Command Action
/tag v1.2.3 <message> Tags this commit with an optional message