_smart_commits_commands
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
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
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
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 'Total work logged' in the Work Log tab of the issue.
- Each value for
w,d,handmcan 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
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 'Fixed this today' to the issue. Note that the comment is added automatically without needing to use the #comment command.
You can see the custom commands available for use with Smart Commits by visiting the JIRA Software issue and seeing its available workflow transitions:
- Open an issue in the project.
- Click View Workflow (near the issue's Status).
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.
If a workflow has two valid transitions, such as:
Start ProgressStart Review
A Smart Commit with the action #start is ambiguous because it could mean either of the two transitions. To specify one of these two transitions, fully qualify the transition you want by using either #start-review or #start-progress.
- When you resolve an issue with the
#resolvecommand, you cannot set the Resolution field with Smart Commits. - If you want to add a comment during the transition, the transition must have a screen associated with it.
- The committer's email address must match the email address of a single JIRA Software user with the appropriate project permissions to transition issues.