Issue closing pattern
all tiers
self-managed

note
This page explains how an administrator can configure issue closing patterns. For user documentation about the feature, see Closing issues automatically.

When a commit or merge request resolves one or more issues, it is possible to automatically close these issues when the commit or merge request lands in the project’s default branch.

Change the issue closing pattern

The default issue closing pattern covers a wide range of words. You can change the pattern to suit your needs.

note
To test the issue closing pattern, use https://rubular.com. However, Rubular doesn’t understand %{issue_ref}. When testing your patterns, replace this string with #\d+, which matches only local issue references like #123.

To change the default issue closing pattern:

  1. Edit /etc/gitlab/gitlab.rb and change the gitlab_rails['gitlab_issue_closing_pattern'] value:

    gitlab_rails['gitlab_issue_closing_pattern'] = /<regular_expression>/.source
    
  2. Save the file and reconfigure GitLab:

    sudo gitlab-ctl reconfigure