テンプレートを使用して Jira Coding Agent の自動化を設定する

Jira Coding Agent は、自動化では繰り返し実行するタスクに使用すると最も効果的です。

すぐに使い始められるように、Jira には、アトラシアン チームが Jira Coding Agent を使用して一般的な繰り返し作業を処理する方法に基づいたテンプレートが用意されています。

使用を開始する

自動化テンプレートを選択する

テンプレートを選択してから、チームのワークフローに合わせて、トリガー、条件、プロンプトを調整します。

テンプレートを使用するには:

  1. Jira スペースで、スペース名の横にある [その他のアクション] () を選択し、[スペース設定] を選択します。

  2. サイドバーで [自動化] を選択し、[テンプレート] タブを開きます。

  3. [Coding agents (コーディング エージェント)] セクションを見つけます。

  4. テンプレートを選択し、それに基づくフローを作成します。

  5. フローの詳細、トリガー、条件、アクションを確認し、必要に応じて更新します。

  6. 準備ができたら、[フローをオンにする] を選択します。


機能フラグ削除の自動化テンプレートの例

機能フラグ削除の自動化テンプレートの例を示します。この例では、[Use Jira Coding Agent (Jira Coding Agent を使用)] アクションを使用します。

この自動化では、フラグのクリーンアップが必要な作業項目が検出され、作業項目の説明またはカスタム プロンプトに基づいてコード変更が適用されます。さらに、レビュー用のプル リクエストの下書きが作成されるため、チームは手作業を減らして、古くなった機能フラグをより迅速に削除できます。

パート 1: テンプレートに基づいて自動化フローを設定する

  1. 自動化テンプレートのリストから、機能フラグ削除テンプレートを選択します。

  2. フローの詳細を確認し、必要に応じて更新します。

  3. [作業項目の更新時] トリガーを選択して確認します。このトリガーには、作業項目に feature-flag-cleanup という新しいラベルが追加されたときに実行される条件が設定されています。

  4. [Use Jira Coding Agent (Jira Coding Agent を使用)] アクションを選択して、リポジトリ設定を確認します。

  5. リストから接続済みのリポジトリを選択します。ただし、作業項目の説明にリポジトリの詳細を追加する場合は、[Infer repository from work item (作業項目からリポジトリを推測)] を選択します。

  6. 作業項目の説明に加えて、追加のコンテキストや指示を含めるためのプロンプトを入力します。プロンプトの例については、次のセクションを参照してください。

  7. [リポジトリ] フィールドの横にある [コード設定] アイコン () を選択し、ブランチ名、ソース ブランチ、その他のブランチ オプションを指定します。

  8. 必要に応じて、作業項目にコメントを追加するアクションを追加します。これにより、自動化が実行され、Jira Coding Agent による作業が完了したときに、チームへ通知できます。

  9. フローを保存します。

プロンプトの例

このプロンプトはあくまでも例です。これを出発点として使用し、具体的なシナリオや要件に合わせて自由に調整してください。

You are a senior software engineer asked to help write code to clean up a stale feature gate from a code repository. You implement code, you don’t guide users, you actually implement the code using the “Use Jira coding agent” action. You MUST Complete below tasks in the following order. You’re authorized to perform the below steps without additional confirmation. 1. Extract feature gate name {gate_name} from Jira ticket title or the field "Feature gate name" 2. Extract the final behaviour {final_gate_value} from "Feature gate Default value" in the Jira ticket description. If it is not provided in the description, infer the default value from the code. 3. Extract the repository {repository_url} from the desired repository 4. Start the feature gate clean up process using the following instructions <TASK_SUMMARY_TEMPLATE> For the following code repository: {repository_url} The feature gate we need to clean up is called: {gate_name} It now always serves the value {final_gate_value}, meaning this feature is now permanent and should be integrated into the main code path. Feature Gate Definition Cleanup: - Remove the feature gate constant/variable definition - Follow imports/references to find all usage of this feature gate including both production code and test files - Remove the feature gate from configuration files (e.g., docker-compose, properties) Feature Gate Usage Cleanup: For conditional blocks checking this feature gate: Keep only the {final_gate_value} path code Remove the conditional wrapper and else blocks entirely For if/else blocks using the feature gate: Replace the entire if/else with just the {final_gate_value} code path Remove any variable assignments that only serve the conditional When removing feature gate parameters: Remove the parameter from method/constructor signatures Find and update ALL calling code by following imports and references When modifying a class: Remove the parameter from the constructor Remove any code blocks using the parameter Update all class methods and properties that depend on the removed parameter Update all code that depends on the class’s interface For test files: Remove tests that only verify feature gate behavior Remove ALL feature gate mocking/setup code Convert parameterized tests that only vary by this gate into regular tests using the {final_gate_value} behavior Remove the feature gate parameter from test method signatures Code Quality Guidelines: Maintain consistent code formatting after removals Preserve any necessary comments/documentation that aren’t specific to the feature gate Keep error handling and logging that isn’t specific to feature gate checks Ensure method signatures remain compatible with their interfaces after parameter removal Speed Optimisations If you are trying to search for text in the codebase using a bash tool, I would use “git grep” over “find . -type f -exec grep” because it much faster The goal is to make the {final_gate_value} behavior permanent by integrating it directly into the code rather than just changing the gate’s default value. </TASK_SUMMARY_TEMPLATE>

パート 2: 作業項目を作成して自動化をトリガーする

  1. Jira スペースで機能フラグをクリーンアップする作業項目を作成します。

  2. 作業項目の詳細に、以下の情報を入力します。

    1. 機能フラグ キー。

    2. Jira Coding Agent が処理するリポジトリ。[Infer repository from work item (作業項目からリポジトリを推測)] オプションを選択している場合、Jira Coding Agent は作業項目に関連付けられたリポジトリを使用します。

    3. ロールアウト後の機能フラグの最終的な値。

  3. 作業項目に feature-flag-cleanup ラベルを追加して、Jira Coding Agent が繰り返し実行するタスクとして認識し、処理を開始できるようにします。ラベルが自動化フローで設定したものと完全に一致していることを確認してください。

作業項目を作成すると、自動化によって直ちにフローがトリガーされ、リポジトリにドラフト プル リクエストが作成されます。

パート 3: Jira Coding Agent が作成したプル リクエストをレビューしてマージする

フローが実行されると、Jira Coding Agent はブランチ上でコードを変更し、指定されたリポジトリにプル リクエストの下書きを作成します。プル リクエストはリポジトリで直接確認するか、Jira の作業項目を開いて以下の中にあるリポジトリ リンクからアクセスできます。

  • [詳細] パネルの [開発] セクション

  • [エージェント] セクション

[Agents (エージェント)] セクションには、その作業項目に関連するすべてのエージェント セッションが表示されます。これには、他のユーザーが所有および管理しているセッションも含まれます。フローの実行時には、接続所有者の Rovo クレジットが使用されます。

Automation における接続とは

自身が所有するセッションの Jira Coding Agent を見つけて変更をレビューし、必要な編集を行ってから、準備ができ次第プル リクエストを承認してマージします。

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。