Issue closing pattern
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 have these issues closed when the commit or merge request lands in the project’s default branch.
Change the issue closing pattern
In order to change the pattern you need to have access to the server that GitLab is installed on.
The default pattern can be located in gitlab.yml.example under the “Automatic issue closing” section.
Tip: You are advised to use http://rubular.com to test the issue closing pattern. Because Rubular doesn’t understand
%{issue_ref}
, you can replace this by#\d+
when testing your patterns, which matches only local issue references like#123
.
For Omnibus installations
- Open
/etc/gitlab/gitlab.rb
with your editor. -
Change the value of
gitlab_rails['gitlab_issue_closing_pattern']
to a regular expression of your liking:gitlab_rails['gitlab_issue_closing_pattern'] = "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
- Reconfigure GitLab for the changes to take effect.
For installations from source
- Open
gitlab.yml
with your editor. -
Change the value of
issue_closing_pattern
:issue_closing_pattern: "\b((?:[Cc]los(?:e[sd]|ing)|\b[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)"
- Restart GitLab for the changes to take effect.
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc