To create a link between your Git commit and a Jira issue, developers must include the issue key into the commit comment.
Commits are selected by issue key. Developers should add them to comments every time the commits are made.
In this case, “TEST-1” is the issue key linking the commit message to the Jira issue.
As a best practice to work with sub-task — put the parent and sub-task Jira issue keys in the commit message so that the commit shows in both places. This way, the commit for the sub-task does not get lost in the many commits of the parent issue.
The Git Integration for Jira app supports commits that used the old Jira key in the commit message after a project rename to a new key name (Example: TEST-16
to PROJ-16
).
There are two scenarios related to the rename/move:
-
The Jira project key was renamed and the commit message contains the old key prior to the installation of the Git Integration for Jira app.
-
The Jira issue was moved from one project to another project and the message contains the old key prior to the installation of the Git Integration for Jira app.
Only the commits that are linked to Jira issues will show on the Jira Activity Stream (not all commits in repositories).