Use a template to set up Jira Coding Agent automations

Jira Coding Agent in automations works best when you use it on repeatable tasks.

To help you get started quickly, Jira includes templates based on how Atlassian teams use Jira Coding Agent to handle common, repetitive work.

使用を開始する

Choose an automation template

Start with a template, then adjust the trigger, conditions, and prompt so the flow fits your team’s workflow.

To use a template:

  1. In your Jira space, select More actions () next to your space name, then select Space settings.

  2. In the sidebar, select Automation, then navigate to the Templates tab.

  3. Find the Coding agents section.

  4. Select the template to create a flow based on it.

  5. Review the flow details, trigger, condition, and action. Update them as needed.

  6. Select Turn on flow when you’re ready.


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

Here’s an example of how you can use the feature flag removal automation template that uses the Use Jira Coding Agent action.

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

Part 1: Set up an automation flow based on the template

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

  2. Review the flow details and update as required.

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

  4. Select the Use Jira Coding Agent action to review the repository settings.

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

  6. Provide a prompt to include additional context or instructions alongside the work item's description. Find an example prompt in the next section.

  7. Select the Code settings icon () next to the Repository field, to specify the branch name, source branch, and other branch options.

  8. Optionally, add another action to add a comment to the work item so that teams get notified when the automation runs and the Jira Coding Agent has finished work.

  9. Save the flow.

プロンプトの例

This is an example prompt only. You can use it as a starting point and then tailor your own prompt to suit your specific scenario and requirements.

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>

Part 2: Create a work item and trigger the automation

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

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

    1. 機能フラグ キー。

    2. The repository that the Jira Coding Agent should work on. The Jira Coding Agent will use the associated repository if you’ve chosen the Infer repository from work item option.

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

  3. Add the feature-flag-cleanup label to the work item, so that the Jira Coding Agent can identify the repetitive task and start working on it. Make sure the label matches exactly to what you’ve set in the automation flow.

Once you create the work item, the automation will trigger the flow immediately and create a draft pull request in your repository.

Step 3: Review and merge the pull request created by the Jira Coding Agent

When the flow runs, the Jira Coding Agent makes code changes on a branch and creates a draft pull request in the repository you provided. You can review the pull request directly in the repository, or open the Jira work item and use the repository link under:

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

  • the Agents section

The Agents section displays all agentic sessions related to that work item, including sessions owned and managed by other users. The connection owner’s Rovo credits are used when the flow runs.

Automation における接続とは

Find the Jira Coding Agent for sessions you own to review the changes, make any edits you need, then approve and merge the pull request when you’re ready.

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

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