Enforcing JIRA IDs in Commits and Merge Requests
Introduction
Section titled βIntroductionβLinking code changes to JIRA issues helps track work and improves auditability.
Enforce via Push Rules
Section titled βEnforce via Push Rulesβ- Navigate to Settings > Repository > Push Rules.
- In Commit message must match this regular expression, enter a pattern that includes your JIRA project key, e.g.,
^[A-Z]+-\d+: .+
- Save the rule. Commits without a JIRA ID will be rejected.
Enforce in Merge Requests
Section titled βEnforce in Merge Requestsβ- Use merge request templates that remind contributors to include
JIRA-123in the title or description. - Combine with approval rules so Maintainers verify the JIRA link before approving.
Best Practices
Section titled βBest Practicesβ- Educate developers on the required format.
- Provide scripts or commit templates to insert the issue ID automatically.
- Use branch naming conventions like
feature/JIRA-123-description.