Link commit message to a Jira ticket
  • Updated on 01 Jun 2019
  • 1 minute to read
  • Contributors
  • Share
  • Dark
    Light

Link commit message to a Jira ticket

  • Share
  • Dark
    Light

This rule ensures a Jira issue key is included in the commit message.

By mentioning the Jira issue key in the (Git) commit message, it's possible to create a link between a specific Jira issue to the relevant commits.

3x-b5015fd-Screen_Shot_2019-01-17_at_11.55.49.png

Use case(s)

  • Create a logical link between planning (Jira) and the subsequent code change (GitHub)
  • Recommended requirement for SOC 2 compliance

When does this rule fail?

When none of the commits in the pull request mention a Jira issue key.

When a pull request is created but fails to mention a Jira issue key in the pull request title.

In order for the integration to work, the Jira ticket number must be mentioned first:
e.g. PROJ-123 add a README file to the project

3x-2bca072-Screen_Shot_2019-01-17_at_14.24.36.png

How to fix?

This rule will pass when at least one of commit in the pull request will mention a Jira issue key
  1. Fix the wrong commit message(s) or add a new commit and mention the relevant Jira ticket in the commit message
  2. Datree's policy check will automatically run to make sure a Jira issue key is mentioned in one of the commits in the pull request


What's Next

Activate a policy
Was this article helpful?