Issue closing pattern
all tiers
self-managed

note
This is the administration documentation. There is a separate user documentation on issue closing pattern.

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
You are advised to use https://rubular.com to test the issue closing pattern. However, since Rubular doesn’t understand %{issue_ref}, you can replace this by #\d+ when testing your patterns, 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