We are using Gitlab (7.10.2) and Redmine (3.0.2).
All issues are managed in Redmine and Gitlab manages all git-repositories.
We set up Gitlab via the UI so far that commits with the message 'Close #234' are clickable and pointing to the corresponding Redmine ticket website.
We now want to achieve that tickets in Redmine are directly linked with Gitlab commits.
If we are using the internal Gitlab issue system and set the commit-message to ‘Close #234’ the ticket 234 is automatic closed and linked with the commit.
But with Redmine as issue service system we are not able to automatic close issues with commits or have any information about this in Redmine.
Does anyone knows how we can modify Gitlab and/or Redmine to close Redmine tickets with Gitlab commits?

- 327
- 1
- 3
- 9
-
You know your question is offtopic and that this is the wrong website to ask questions about general purpose software? – N.B. May 11 '15 at 20:46
-
I just tried to find some help about a git hook like a post-commit bash script or something else to trigger the redmine-ticket api after a gitlab commit. – Lonely Island May 11 '15 at 20:52
-
I'm just saying that you'd have better luck on another stackexchange site, dedicated to poweruser stuff or similar. It's unlikely you'll get help here honestly. Your question is not about programming problem, it's about software. I'd like to help but I don't know how to hook the two. Maybe you luck out and get someone who knows. – N.B. May 11 '15 at 20:53
1 Answers
You can use Redmine as an issue tracker with setting the redmine service in Gitlab (In your project -> Services -> Redmine -> fill the URLs, and set active). If this works, when you press "new issue" button in Gitlab, you are redirected to Redmine new issue page. In Gitlab you should have WebHook to inform the Redmine about new push into the repo. This can be set in the settings "In your project -> Settings -> Web hooks" (how, see here).
In Redmine go to Administration -> Settings -> Repositories. Check your referencing keywords. "closes" or "close" should be in the list. Finally in the same tab there is the table at the bottom, where you choose tracker, your fixing keyword (closes, close), set applied status to "Closed", and choose the appropriate amount of % Done (100%).
Similarly you can set other keywords to change status in Redmine tickets.
Use the redmine_gitlab_hook to keep Redmine repo up-to date.

- 1,696
- 1
- 15
- 25
-
Great. This works perfect. Thank you! @N.B. I have to admit: I should have asked my question on poweruser :-) – Lonely Island Jun 24 '15 at 11:01
-
Hello, this thread is really useful. Could you explain better "In Gitlab you should have WebHook to inform the Redmine about new push into the repo" – Riccardo79 Jan 21 '16 at 10:13
-
-
Thanks for reply. Could you provide me an example about the webhook URL? Moreover is a PUSH webhook? – Riccardo79 Jan 21 '16 at 11:33
-
Hi @Riccardo79, please see the link I provided now, read the "instalation/gitlab" part (https://github.com/phlegx/redmine_gitlab_hook). Hope it helps. – mcane Jan 21 '16 at 11:49
-
Ok, this means that I need to install a local git repository on Redmine with a copy of my project! Is it true? – Riccardo79 Jan 21 '16 at 11:54
-
-
what if I have redmine and gitlab on the server? do I have to copy git repo under redmine folder? – pbms Dec 04 '18 at 14:10
-
@Pbms I'm sorry I don't use this setting anymore, but I think that Redmine has it's own clone of repo and with each change can make own diffs on local copy to extract the info. Probably this is also more safe and easier as directly pinging the Gitlab. – mcane Dec 11 '18 at 14:00