I need help setting up a connection between GitLab and Jira for commit messages. What I want is when someone makes a commit like this:
TICKET-123: Fixed login bug
I want GitLab to automatically create a link to the corresponding Jira ticket when viewing the commit in the GitLab interface.
Right now the only solution I found completely replaces GitLab’s issue system with Jira integration. This makes the Issues tab in GitLab redirect to Jira instead.
But I don’t want that. I still want to use GitLab for creating and managing issues normally. I just want commit messages that follow a specific format to show links to Jira tickets.
Is there a way to do this without losing GitLab’s built-in issue functionality? I’m working with the community edition of GitLab.
had the same issue couple months back and theres actually an easier workaround. just go to project settings > general > custom issue tracker service and add your jira url pattern there. no need for complex regex stuff - gitlab automatically picks up TICKET-### patterns in commits and makes them clickable links to jira while keeping your gitlab issues working normally.
Actually ran into this exact scenario last year when our team migrated from Bitbucket. What worked for us was configuring a simple external issue tracker in GitLab settings instead of the full Jira integration. Navigate to your project settings, then Integrations, and select External Issue Tracker. You’ll need to set up URL patterns that match your Jira ticket format - something like https://yourjira.com/browse/$id where $id captures the ticket number from your commit messages. The key difference from what Harry mentioned is that you don’t need complex regex patterns for basic TICKET-XXX formats. GitLab will automatically detect these patterns in commit messages and convert them to clickable links. This approach keeps your GitLab issues intact while providing the Jira linking you need. We’ve been using this setup for over a year without any issues on the community edition.
Six months ago, I faced a similar challenge. The solution lies in utilizing GitLab’s custom issue trackers feature rather than the full integration with Jira. You can access this in your project settings under Integrations. There, you can configure it to recognize specific ticket patterns without affecting GitLab’s issue management. By setting a regex pattern for the TICKET-XXX format and defining the corresponding URL template for your Jira instance, links will automatically appear in commit messages. This preserves your GitLab issue functionality while enabling clickable links, and it’s supported in the community edition, though the setup may vary a bit from the premium version. It’s crucial to test your regex thoroughly to ensure everything links correctly.