There are smart commits commands that you can use in your commit messages. Read on to learn more details on each smart commit command and how they work.
#comment
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.
#time
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.
#<transition-name>
The #<transition-name>
command will move the Jira issue to a particular workflow state.
Syntax: ISSUE_KEY #<transition-name> [Your commit comment text]
Examples:
GIT-264 #code-review For review.
GIT-1720 #close Closing ticket. #comment Tasks completed.
1 – The first example will transition the Jira issue to the specified workflow state and adds the comment message to the commit.
2 – 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 Jira Server/DC, only the mentioned
#comment
text is added to the Commits tab.
For more information on transitions and workflow names and how they work, see Workflow Transitions.
#assign
The #assign
command will assign the particular issue to the specified Jira user.
Syntax: ISSUE_KEY #assign [Jira username or email of Jira user]
Examples:
GIT-1925 #assign johnsmith
GIT-1961 #assign [email protected]
#fixversion
The #fixversion
command will add a Fix Version/s details tag to the specified issue.
Syntax: ISSUE_KEY #fixversion [project version]
Examples:
GIT-1628 #fixversion 2.9.6
GIT-1628 #fixversion 2.9.5 #fixversion 2.9.6
-
The first example adds fix version tag 2.9.6 to the issue,
GIT-1628
. -
The second example adds fix version tags 2.9.5 and 2.9.6 to the issue,
GIT-1628
.If there was an initial Fix Version tag on the specified issue, a
#fixversion
command will append the new Fix Version tag to it.For instance:
The Fix Version tag,2.9.4
, already exists in issue GIT-1254.Performing the smart commit, GIT-1254 #fixversion
2.9.5
, will give a result of:Fix Version/s: 2.9.4, 2.9.5
#affectsversion
The #affectsversion
command will add an Affect Version/s details tag to the specified issue.
Syntax: ISSUE_KEY #affectsversion [project version]
Example:
GIT-1582 #affectsversion 2.9.6
The #affectsversion
command works the same way as #fixversion
. However, it appends Affect Version/s tag instead to the specified issue.
#label
v3.5+ Available in Jira Server
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