Closing a GitLab Issue while on a different branch

Viewed 43

I can close issues from the main branch, but if I'm on the 'dev' branch or another branch, the issues don't get closed. In the documentation, it says that closing commit issues can only be done on the master branch. Is there a way to do it? Or is it impossible?

1 Answers

It seems like you answered your own question. Per the documentation, automatic closing of issues only applies when commits are added to the default branch of the project.

While there is no feature for this provided by GitLab, you can implement this yourself as an alternative. For example, if you are using GitLab CI, you could develop your own CI job that uses the issues API to find and close issues. However, you will need to implement the applicable logic yourself.

Related