Processing JIRA Software issues with Smart Commit messages
When you manage your project's repositories in Bitbucket or GitHub, or use FishEye to browse and search your repositories, you can process your JIRA Software issues using special commands, called Smart Commits, in your commit messages.
You can:
- comment on issues
- record time tracking information against issues
- transition issues to any status defined in the JIRA Software project's workflow.
Smart Commit commands
The basic command line syntax for a Smart Commit message is:
<ignored text> <ISSUE_KEY> <ignored text> #<COMMAND> <optional COMMAND_ARGUMENTS>
Any text between the issue key and the Smart Commit command is ignored.
There are three Smart Commit commands you can use in your commit messages:
- comment
- time
- transition
Comment
Adds a comment to a JIRA Software issue.
<ignored text> ISSUE_KEY <ignored text> #comment <comment_string>
JRA-34 #comment corrected indent issue
Example:
The ISSUE_KEY is case-sensitive.
The committer's email address must match the email address of a single JIRA Software user with permission to comment on issues in that particular project.
Time
Records time tracking information against an issue.
<ignored text> ISSUE_KEY <ignored text> #time <value>w <value>d <value>h <value>m <comment_string>
JRA-34 #time 1w 2d 4h 30m Total work logged
Example:
This example records 1 week, 2 days, 4 hours and 30 minutes against the issue, and adds the comment 'Total work logged' in the Work Log tab of the issue.
- Each value for w, d, h and m can be a decimal number.
- The committer's email address must match the email address of a single JIRA Software user with permission to log work on an issue.
- Your system administrator must have enabled time tracking on your JIRA Software instance.
Workflow transitions
Transitions a JIRA Software issue to a particular workflow state.
<ignored text> ISSUE_KEY <ignored text> #<transition_name> <comment_string>
JRA-090 #close Fixed this today
Example:
The Smart Commit only considers the part of a transition name before the first space. So, for a transition name such as finish work, then specifying #finish is sufficient. You must use hyphens to replace spaces when ambiguity can arise over transition names, for example: #finish-work.
Advanced examples
Multiple commands over multiple lines on a single issue
JRA-123 #comment Imagine that this is a really, and I
mean really, long comment #time 2d 5h
Multiple commands on a single issue
JRA-123 #time 2d 5h #comment Task completed ahead of schedule #resolve
A single command on multiple issues
JRA-123 #time 2d 5h #comment Task completed ahead of schedule #resolve
Multiple commands on multiple issues
JRA-123 JRA-234 JRA-345 #resolve #time 2d 5h #comment Task completed ahead of schedule
Processing JIRA Software issues with Smart Commit messages
By Jayson Buquia
Processing JIRA Software issues with Smart Commit messages
- 594