Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Contact Support: Server  
Contact Support: Data Center  

Smart commits – Advanced examples

A single action on a single issue

TEST-100 #time 2w 1d 4h 30m This is a time log comment

Records the specified worklog #time of 2 weeks, 1 day, 4 hours and 30 minutes and adds worklog comment "This is a time log comment" to the issue, TEST-100.

Multiple actions on a single issue

TEST-100 #time 4h 30m Fix null pointers #comment Fixed code #resolve

Logs specified #time of 4 hours and 30 minutes and add worklog comment "Fixed null pointers" to the issue, TEST-100; adds the #comment "Fixed code" and resolves the issue.

A single action on multiple issues

TEST-100 TEST-101 TEST-102 #resolve

Resolves specified issues.

Multiple actions on multiple issues

TEST-100 TEST-101 TEST-102 #resolve #time 2d 4h #comment Fixed code

Resolves specified issues; logs specified #time of 2 days and 4 hours and adds #comment "Fixed code" against the issues.

Support is already implemented for multi-line commit messages with smart commits.

Multi-line examples

The following examples show correct usage of the smart commit message (multi-line):

TST-1 implemented feature 1
TST-1 #comment some comment
in Jira
on several lines
TST-1 #resolve
TST-2 #time 1h 30m

In this example, an issue key that is present on every line is a valid multi-line commit message.

TST-1 implemented feature 1
#comment some comment
in Jira on several lines
#resolve TST-2
#time 1h 30m

This is the equivalent smart commit message based from the above example.

TEST-3 Background color of settings should be lighter
TEST-3 #in-progress #time 1h
TEST-4 resolve TEST-2 #resolve

This example, containing several issue keys, is also a valid multi-line smart commit message.

Have feedback about this article? Did we miss something? Let us know!
On this page