So I wanted to allow different languages for the pattern in commits and merge request to automatically close issues. I found the documentation here stating that you can edit this pattern in the GitLab configuration.
https://docs.gitlab.com/ee/administration/issue_closing_pattern.html
The default pattern is this:
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ff]ix(?:e[sd]|ing)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)
Which would match English words for closing, fixing, resolving, implementing etc.
I thought it would be a simple matter to edit and add my own but when I do issues are no longer automatically closed.
This is my updated pattern för Swedish:
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ss]täng(?:er)?|\b[Ll]ös(?:er)?|\b[Ff]ix(?:e[sd]|ing|ar)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing|erar)?)(:?) +(?:(?:issues? +|ärenden? +)?%{issue_ref}(?:(?:, *| +and +| +och +)?)|([A-Z][A-Z0-9_]+-\d+))+)
At first I thought maybe it didn’t like having unicode characters in the string so I tried replacing them with escaped unicode characters:
\b((?:[Cc]los(?:e[sd]?|ing)|\b[Ss]t\u00e4ng(?:er)?|\b[Ll]\u00f6s(?:er)?|\b[Ff]ix(?:e[sd]|ing|ar)?|\b[Rr]esolv(?:e[sd]?|ing)|\b[Ii]mplement(?:s|ed|ing|erar)?)(:?) +(?:(?:issues? +|\u00e4renden? +)?%{issue_ref}(?:(?:, *| +and +| +och +)?)|([A-Z][A-Z0-9_]+-\d+))+)
That did not appear to work either though.
Anyone got any idea what I’m doing wrong? I’m trying to add onto the existing list of closing, fixing etc the Swedish equivalents.