April 30th 1 PM ET

Git Integration for Jira Cloud Documentation

Smart commits – Basic Commands

There are smart commits commands that you can use in your commit messages. Read on for more details on each smart commit command.

#comment

This command works both in Jira Server/Cloud.

The #comment command will add a comment to a Jira issue.

Syntax:
ISSUE_KEY #comment [your comment text]

Examples:
GIT-264 #comment Resolved conflicts.
GIT-1720 #comment Plugin version change from 2.8.2 to 2.8.3. Build number change from 69 to 70.

The above examples will add the specified comment text against the Jira issues.

The committers’ email address in the git configuration must match with the email address of the corresponding Jira user (or vice versa) to comment on issues.

 

#time

This command works both in Jira Server/Cloud.

The #time command will record time tracking information against a Jira issue.

Syntax:
ISSUE_KEY #time [Some amount in Jira time syntax] [Your worklog comment text]

Examples:
GIT-264 #time 1w 6d 13h 52m Total work logged.
GIT-1720 #time 1h 20m Merged to master. Released to marketplace.

The above examples will add the respective time and worklog comment text against the Jira issues.

The Jira time tracking feature allows users to log the length of time spent working on issues. Jira administrators must have enabled this feature for this smart commit to work.

#<transition-name>

This command works both in Jira Server/Cloud.

The #<transition-name> command will move the Jira issue to a particular workflow state.

The Jira user must have the appropriate project permissions to be able to transition issues.

Syntax:
ISSUE_KEY #<transition-name> [Your commit comment text]

Examples:
GIT-264 #code-review For review.
GIT-1720 #close Closing ticket. #comment Tasks completed.

The first example will transition the Jira issue to the specified workflow state and adds the comment message to the commit.

The second example will transition the Jira issue to the specified workflow state, adds the comment “Closing ticket” to the Comment tab and adds the specified comment, “Task completed” to the mentioned Jira issue.

For more information on transitions and workflow names and how they work, see Workflow Transitions.

 

#assign

This command works both in Jira Server/Cloud.

The #assign command will assign the particular issue to the specified Jira user. This command works in Jira Server/Cloud.

Syntax:
ISSUE_KEY #assign [Jira username or email of Jira user]

Examples:
GIT-1925 #assign johnsmith
GIT-1961 #assign [email protected]

 

#label

This command works both in Jira Server/Cloud.

The #label command will add a new label to a Jira issue. If more than one Jira issue is referenced, the labels are added to all mentioned Jira issues. Multiple labels can be created by putting spaces between words.

Syntax:
ISSUE_KEY(S) #label [label1] .. [labeln]

Examples:
GITCL-443 #label bucketbreakfix bucketenhancement
GITCL-443 GITCL-247 GITCL-214 #label [email protected] [email protected] requested-feature new-feature #comment Return email when implemented

 


Prev: Smart commits (index)

Next: Smart commits – Advanced examples

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