Smart Commits allow repository committers to perform actions such as transitioning JIRA Software issues or creating Crucible code reviews by embedding specific commands into their commit messages.

以下のことが可能です。

  • 課題にコメントする
  • 課題の時間管理情報を記録する
  • transition issues to any status defined in the JIRA Software project's workflow.

There are other actions available if you use Crucible. See below for more information.

Each Smart Commit message must not span more than one line (i.e. you cannot use a carriage return in the command), but you can add multiple commands to the same line. See this example below.

 

Smart Commit commands for Crucible reviews

When creating a new review using a Smart Commit the default project objectives are added to the review, and since Fisheye/Crucible 2.10.2, the commit message is also copied to the review objectives.

Note that you cannot add arbitrary objectives to the review using a Smart Commit.

Create a review

説明 Create a review in Crucible.
構文
<commit message> +review <project key>
Fix a bug +review CR-TEST
注意

The +review  command creates a new review in the project CR-TEST with the content of the changeset. The review will be in a draft state unless the project has default reviewers or reviewers are explicitly mentioned. If you only have one project in Crucible, or a repository is a project's default repository, it is not necessary to mention the project key.

Add reviewers

説明 Add reviewers when creating a new review in Crucible.
構文
<commit message> +review <project key> <reviewer_1> <reviewer_2>... <reviewer_n>
Fix a bug +review CR-TEST @jcage @skhan
注意

The command will create a new review in PROJ and add the users jcage and skhan to the review. The review will be automatically started if reviewers are specified.

Note that you cannot add reviewers to existing reviews using Smart Commits.

Update a review

説明  Iteratively add new code changes to a review
構文
<commit message> +review <review key>
Implement rework on past work +review CR-TEST-123
注意

Often, reviews require rework and changes in response to comments left by the team. When committing these changes, adding the review key will iteratively add these new changes to the review.

注意:

  • Each commit command in the Smart Commit must not span more than one line (i.e. you cannot use carriage returns). However, you can use multiple commands in the same commit message, and these can be on the same line.
  • Creating a review in Crucible using a Smart Commit requires that the author of the changeset has already been mapped to a Crucible username. See 'Author mapping' on Changing your user profile.

高度な例

単一の課題に複数のコマンド

構文

<ISSUE_KEY> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS>

コミット メッセージ

JRA-123 #time 2d 5h #comment Task completed ahead of schedule #resolve

結果

課題 JRA-123に対して、2 日と 5 時間作業を記録し、コメント「Task completed ahead of schedule」を追加して
課題を解決します。

Multiple commands over multiple lines on a single issue

構文

<ISSUE_KEY> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS>

コミット メッセージ

JRA-123 #comment Imagine that this is a really, and I 
mean really, long comment #time 2d 5h

結果

コメント "Imagine that this is a really, and I" は追加されますが、残りのコメントは削除されます。2 行目の time コマンドに課題キーがないため、作業時間の 2 日と 5 時間は課題に記録されません。つまり、コミット メッセージの各行がスマート コミット構文に準拠している必要があります。

この例では、以下のように設定すると、想定通りに動作します。

JRA-123 #comment Imagine that this is a really, and I mean really, long comment 
JRA-123 #time 2d 5h

複数の課題に対して単一コマンドを使用

構文

<ISSUE_KEY1> <ISSUE_KEY2> <ISSUE_KEY3> #<COMMAND> <optional COMMAND_ARGUMENTS> etc         

コミット メッセージ

JRA-123 JRA-234 JRA-345 #resolve

結果

課題 JRA-123、JRA-234 および JRA-345 を解決。

複数の課題キーはホワイトスペースまたはコンマで区切る必要があります。

複数の課題に対して複数のコマンドを使用

構文

<ISSUE_KEY1> <ISSUE_KEY2> ... <ISSUE_KEYn> #<COMMAND_1> <optional COMMAND_1_ARGUMENTS> #<COMMAND_2> <optional COMMAND_2_ARGUMENTS> ... #<COMMAND_n> <optional COMMAND_n_ARGUMENTS>

コミット メッセージ

JRA-123 JRA-234 JRA-345 #resolve #time 2d 5h #comment Task completed ahead of schedule

結果

課題 JRA-123、JRA-234 および JRA-345に対して、2 日と 5 時間作業を記録し、コメントを追加します。
3つの課題すべてにコメント「Task completed ahead of schedule」を追加し、3つの課題すべてを解決します。

複数の課題キーはホワイトスペースまたはコンマで区切る必要があります。

Smart Commit の活用

Your FishEye administrator must have:

注意:

  • Smart Commits only support the default JIRA Software issue key format (that is, two or more uppercase letters, followed by a hyphen and the issue number, for example BAM-123).
  • Smart Commits don't provide for field-level updates in JIRA Software issues.
  • When using Smart Commits you can use linkers that create a hyperlink to the JIRA Software issue. See Linkers for more information.

  • If there are any errors during the processing of Smart Commits, they will be logged to FishEye's error console, as well as emailed to the actioning users. Speak to your FishEye administrator about Configuring SMTP.

If the application link to JIRA Software is configured to use OAuth, the committing user must authenticate with JIRA Software before any Smart Commit will work with JIRA Software.

  1. Create a test review in FishEye.
  2. Log in as the committing user.
  3. Open the review and click Edit Details.
  4. Enter a JIRA Software issue key for 'Linked Issue' and click Link. You'll be prompted to authenticate.
  5. Do this for every committing user (there's no need to create a new review, just link the review to any JIRA Software issue).