Processing issues with Smart Commits
Smart Commit commands
The basic 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 command is ignored.
There are three commands you can use in your Smart Commit messages:
Comment
Description | Adds a comment to a JIRA Software issue. |
---|---|
Syntax | <ignored text> <ISSUE_KEY> <ignored text> #comment <comment_string> |
Example | JRA-34 #comment corrected indent issue |
Notes |
|
Time
Description | Records time tracking information against an issue. |
---|---|
Syntax | <ignored text> <ISSUE_KEY> <ignored text> #time <value>w <value>d <value>h <value>m <comment_string> |
Example | JRA-34 #time 1w 2d 4h 30m Total work logged |
Notes | This example records 1 week, 2 days, 4 hours and 30 minutes against the issue, and adds the comment '
|
Workflow transitions
Description | Transitions a JIRA Software issue to a particular workflow state. |
---|---|
Syntax | <ignored text> <ISSUE_KEY> <ignored text> #<transition_name> <comment_string> |
Example | JRA-090 #close Fixed this today |
Notes | This example executes the close issue workflow transition for the issue and adds the comment ' You can see the custom commands available for use with Smart Commits by visiting the JIRA Software issue and looking at its available workflow transitions:
The Smart Commit only considers the part of a transition name before the first space. So, for a transition name such as If a workflow has two valid transitions, such as:
A Smart Commit with the action
|
Advanced examples
Multiple commands on a single issue
Syntax | <ISSUE_KEY> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS> |
---|---|
Commit message | JRA-123 #time 2d 5h #comment Task completed ahead of schedule #resolve |
Result | Logs 2 days and 5 hours of work against issue JRA-123, adds the comment 'Task completed ahead of schedule', and resolves the issue. |
Multiple commands over multiple lines on a single issue
Syntax | <ISSUE_KEY> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS> |
---|---|
Commit message | JRA-123 #comment Imagine that this is a really, and I mean really, long comment #time 2d 5h |
Result | Adds the comment 'Imagine that this is a really, and I', but drops the rest of the comment. The work time of 2 days and 5 hours is not logged against the issue because there is no issue key for the # This example would work as expected if set out as: JRA-123 #comment Imagine that this is a really, and I mean really, long comment JRA-123 #time 2d 5h |
A single command on multiple issues
Syntax | <ISSUE_KEY1> <ISSUE_KEY2> <ISSUE_KEY3> #<COMMAND> <optional COMMAND_ARGUMENTS> etc |
---|---|
Commit message | JRA-123 JRA-234 JRA-345 #resolve |
Result | Resolves issues JRA-123, JRA-234 and JRA-345. Multiple issue keys must be separated by whitespace or commas. |
Multiple commands on multiple issues
Syntax | <ISSUE_KEY1> <ISSUE_KEY2> ... <ISSUE_KEYn> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS> |
---|---|
Commit message | JRA-123 JRA-234 JRA-345 #resolve #time 2d 5h #comment Task completed ahead of schedule |
Result | Logs 2 days and 5 hours of work against issues JRA-123, JRA-234 and JRA-345, adds the comment Multiple issue keys must be separated by whitespace or commas. |
Get Smart Commits working
It's easy to get Smart Commits working for your instance of JIRA Software:
Tool | Connection instructions |
---|---|
Bitbucket Cloud | First, link your JIRA Software and Bitbucket accounts. See Connect Jira Cloud to Bitbucket. Then, enable Smart Commits in JIRA Software. See Enable Smart Commits. |
GitHub | First, link your JIRA Software and GitHub accounts. See Connect Jira Cloud to GitHub. Then, enable Smart Commits in JIRA Software. See Enable Smart Commits. |
Bitbucket Server | Create an application link between JIRA Software and Bitbucket Server. See Linking Bitbucket Server to JIRA. Then, enable Smart Commits in JIRA Software. See Enable Smart Commits. |
FishEye | Create an application link between JIRA Software and FishEye. See Linking to another application. Then, enable Smart Commits in JIRA Software. See Enable Smart Commits. |
Crucible | Create an application link between JIRA Software and Crucible. See Linking to another application. Then, enable Smart Commits in JIRA Software. See Enable Smart Commits. |
Notes
Smart Commits only support the default JIRA Software issue key format. This format is two or more uppercase letters, followed by a hyphen and the issue number, for example JRA-123.
- A DVCS such as Git includes a user's email address in the commit data. Users configure this email address in their local system. Smart Commits requires that this email address match exactly one email address in the JIRA Software user base. If the email address matches to multiple users in JIRA Software, or the user does not have permissions for the requested action, the Smart Commit action will fail. The commit itself will succeed however, and will show on the issue. Mismatched email addresses is a common reason why Smart Commits fail to work as expected. If a Smart Commit fails, JIRA Software sends an email notification to either the JIRA Software user, or to the DVCS user (if a JIRA Software user can't be identified). In rare cases, JIRA Software doesn't have either of these email addresses, and the Smart Commit fails silently.
- Smart Commits relies on the JIRA DVCS Connector Plugin when your repositories are hosted in Bitbucket Cloud or GitHub. The plugin is bundled with JIRA Software, but if necessary, a JIRA administrator can install it directly from within the JIRA administration area. In JIRA, go to Add-ons > Find new Add-ons. See Installing add-ons.