トリガーされない Jira 自動化ルールのトラブルシューティング
ページの移動
This page has been moved. Any new changes should be added to the new URL:https://support.atlassian.com/ja/automation/kb/automation-for-jira-troubleshooting-guide-for-situations-where-automation/
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
Jira 自動化で設定されたルールは、イベント (課題の作成、課題の更新、新しいコメントの追加など) によってトリガーされます。ルールが正しく機能していれば、アクションが実行されたかどうかにかかわらず、設定されているイベントをリッスンして、監査ログに新しいエントリが追加されます。ただし、状況によっては、自動化ルールで一部のイベントの「見逃し」や「スキップ」が発生する場合もあります。
This article lists the most common reasons why a rule wasn't triggered as expected and how to identify them.
このページの内容
- "ルールがトリガーされない" とは
- 環境要件
- Identifying error's root cause
- 原因
- 根本原因 1: ルールが無効になっている
- Root cause 2: Allow rule trigger option is disabled
- 根本原因 3: Jira Data Center クラスターの 1 つのノードで Jira 自動化が無効になっている
- Root cause 4: Jira automation threads aren't running on one node in the Jira Data Center cluster
- Root cause 5: Rule should be triggered on the ISSUE CREATE event, but the wrong event (or no event) is fired in the workflow
- Root cause 6: Rule should be triggered on the ISSUE CREATED event, and the issue was created from a CSV import
- 根本原因 7: サードパーティのアプリが原因で、すべての Jira 自動化実行スレッドが停止しています
- Root cause 8: Rules configured with the "Field value changed" trigger aren't triggered due to the "Field Security Plugin for Jira" app
- 根本原因 9: 「複数の課題イベント」トリガーで構成されたルールが、イベントが別のルールによって公開された場合、トリガーされない
- 根本原因 10 - 同じイベントによって複数のルールがトリガーされ、そのうちの 1 つが完了するまでに 5 分以上かかる
- 根本原因 11: ルールが「複数の課題イベント」トリガーを使用して設定されており、間違ったイベントが選択されている
- 根本原因 12: ルールが "SLA しきい値違反時" トリガーを使用して設定されている
"ルールがトリガーされない" とは
First, let's clarify what "a rule isn't triggered" means in the context of Jira automation:
- ここでは、新しい課題が作成されるとトリガーされるように Jira 自動化ルールが設定されていると仮定します。
- Let's assume two issues were created after the rule was configured, with keys SCRUM-73 and SCRUM-74. When checking the rule audit logs, if no entry is showing at all for an issue (issue key SCRUM-73 in the example below), then it means that the rule didn't get triggered for this issue:
If you expected an automation rule to be triggered upon a particular event, but no entry was recorded in the audit logs, then one of the root causes listed below might help you.
環境要件
Jira Data Center 10.0 以降、Jira Data Center (Software と Service Management の両方) の一部として Jira 自動化 (以前の Automation for Jira) を統合しました。これは、Jira または Universal Plugin Manager (UPM) 経由で便利にアップグレードできます。Jira 自動化のエクスペリエンスを最適化かつ強化するため、Jira 10.0 からは Jira 自動化をバンドル バージョンとしてのみ提供することにしました。
このガイドは、以下を使用していることを前提としています。
- Jira Data Center 8.0.0 以降
- Jira 自動化の Data Center 7.4.0 以降
Identifying error's root cause
関連する根本原因を特定するには、次の手順に従います。
- Ensure the automation rule that wasn't triggered is enabled. If it's disabled as shown in the screenshot below, go to Root cause 1: Rule is disabled.
- On the Rule details page, check the Allow rule trigger setting. If you see that the automation rule only occasionally doesn't trigger, and if the events that are missed were caused by other automation rules, check out Root cause 2: Allow rule trigger option is disabled.
- 影響を受けるルールが使用しているトリガーのタイプを確認してください。
- 影響を受ける自動化ルールの例の監査ログをご確認ください。自動化ルールがトリガーされても、そのルールで一部の課題が断続的にスキップされることが頻繁に起きる場合は (以下の例のように)、根本原因 3 または根本原因 4 が関連している可能性があります。
- Check if Jira automation is enabled in the Jira application: go to Settings
> Manage Apps > Manage Apps.
- Jira Data Center のクラスター ノードの場合、Jira 自動化が特定のノードで無効になっている場合があるため、各 Jira ノードで Jira 自動化が有効になっているかを確認することが重要です。Jira 自動化が少なくとも 1 つのノードで無効になっている場合は、根本原因 3 に進みます。
- To check the state of Jira automation:
- Log directly into each node (by bypassing the Load Balancer) and go to Settings
> Manage Apps > Manage Apps.
または、各ノードからサポート zip を生成し、application.xml ファイルで
Jira automation
を検索します。ノードで Jira 自動化が無効になっていると、次のように表示されます。<plugin> <key>com.codebarrel.addons.automation</key> <name>Jira automation</name> <version>8.0.0</version> <vendor>Atlassian</vendor> <status>DISABLED</status> <vendor-url>https://atlassian.com/</vendor-url> <framework-version>2</framework-version> <bundled>User installed</bundled> </plugin>
- Log directly into each node (by bypassing the Load Balancer) and go to Settings
- If Jira automation is enabled on all the nodes of the Jira Clusters, but automation rules are randomly skipping some issues, then the next steps is to generate thread dumps and search for the automation threads. If you see that most Jira automation threads are missing in the thread dumps on at least one node, then this node is "not healthy" and Root cause 4 is relevant:
- 単に比較する際は、Jira ノードが健全であれば、次のスレッドが見つかるはずです。
- 単に比較する際は、Jira ノードが健全であれば、次のスレッドが見つかるはずです。
- When analyzing the thread dumps, if you find that all the Jira automation threads automation-rule-executor:thread-X are in the BLOCKED state (as shown in the example below) or in the TIMED_WAITING state, then Root cause 7 might be relevant:
原因
根本原因 1: ルールが無効になっている
ルールが無効になっていると、そのルールは設定されたイベントのリスニングを停止し、トリガーされなくなります。
Root cause 2: Allow rule trigger option is disabled
初期設定では、新しいルールの [ルール トリガーを許可] オプションが無効になっています。このような場合、ルールがリスニングしているイベントが別の自動化ルールの結果として発生すると、このルールはそのイベントを無視します。
To allow other automation rules to trigger this rule, in the Rule details, select Allow rule trigger.
このシナリオとその解決状況に関する詳細については、記事「Jira 自動化: トリガーが別のルールから発生した場合にルールがトリガーされない」をご参照ください。
根本原因 3: Jira Data Center クラスターの 1 つのノードで Jira 自動化が無効になっている
Data Center 環境で Jira ノードのクラスターを使用している場合やノードが正常に起動しなかった場合は、その特定のノードで Jira 自動化が無効になっている可能性があります。
この場合、次のようになります。
- そのノードで課題が作成または更新されるたびに、この課題によって発生したイベントは Jira 自動化によって無視されます。該当のイベントはそのノードで無効になっているためです。
- the common symptom is that automation rules are triggered for most issues, but they're also skipping issues.
このシナリオとその解決状況に関する詳細については、記事「Jira 自動化: アプリが無効化されているために一部の Jira 課題でルールがトリガーされない」をご参照ください。
Root cause 4: Jira automation threads aren't running on one node in the Jira Data Center cluster
Data Center 環境で Jira ノードのクラスターを使用している場合、Jira 自動化がすべてのノードで有効になっているのに、何らかの理由で、起動時にそれ自体のスレッドの初期化に失敗することがあります。Jira 自動化がそれ自体のスレッドの初期化に失敗する理由は不明ですが、まれなケースとして起こる可能性があります。
この場合、次のようになります。
- そのノードで課題が作成または更新されるたびに、この課題によって発生したイベントは Jira 自動化によって無視されます。該当のイベントはそのノードで無効になっているためです。
- the common symptom is that automation rules are triggered for most issues, but they're also skipping issues.
You can find more information about this scenario and its resolution in the following article: Jira automation: Rules aren't triggered for some Jira issues due to missing threads.
Root cause 5: Rule should be triggered on the ISSUE CREATED event, but the wrong event (or no event) is fired in the workflow
Rules that are triggered when new issues are created rely on the "issue created" event to be fired by the Jira application. By default, any workflow is configured to fire the "issue created" event using the issue creation, so that any functionality that relies on this event (such as Jira notifications or automation rules) can be triggered.
ワークフローの作成トランジションの事後操作が別のタイプのイベントを発生させるように編集された場合 (またはいかなるイベントも発生させない場合)、このイベントに依存する自動化ルールはトリガーされなくなります。
ワークフローが課題作成時に正しいイベントを発生させているかどうかを確認する方法は次のとおりです。
- Go to the workflow associated to the type of the created issue for which you expected the rule to be triggered.
- Select Create transition and then the post functions link.
- Check the event that is fired in the post functions, and verify that it's either:
- ID 1 のイベント (「課題の作成」イベント) を発生させる。
- Or explicitly firing the "issue created" event.
- ID 1 のイベント (「課題の作成」イベント) を発生させる。
Root cause 6: Rule should be triggered on the ISSUE CREATED event, and the issue was created from a CSV import
Jira ですぐに使える CSV インポートには次の 2 タイプがあります。
- 一括作成 ([課題] > [CSV から課題をインポート] からアクセス可能)
- CSV External System Import, that you can access in Settings
> System > External system import > CSV.
最初のタイプのインポートは、"課題を作成" プロジェクト権限とプロジェクトに対する "一括変更" グローバル権限が付与されたユーザーが利用できますが、2 番目のタイプのインポートは Jira システム管理者ユーザーのみが利用できます。
注意すべき重要な点は、このインポートで課題が作成されたときに、2 番目のタイプのインポートでは「課題の作成」イベントがトリガーされないということです。そのため、このイベントがトリガーされることに依存する Jira (またはサードパーティ アプリ) 機能はトリガーされません。該当する機能には以下が含まれます。
- Jira のネイティブ Webhook
- Jira automation's "Issue Created" Trigger
- 「課題の作成」イベントに基づくメール通知
この挙動は、機能リクエストで追跡されます。「課題の作成」または「課題の更新」イベントは、CSV 外部システム インポートを使用して課題をインポートしてもトラップされません。
トリガーされなかった自動化ルールが「課題の作成」イベントで設定されている場合、および課題が CSV 外部システム インポートを使用して作成された場合は、この挙動は想定どおりであり、この根本原因が関連しています。インポートされた課題に対してルールが確実にトリガーされるように、一括作成 CSV インポートを代用してください。
根本原因 7: サードパーティのアプリが原因で、すべての Jira 自動化実行スレッドが停止しています
Jira 自動化実行スレッド automation-rule-executor:thread-X は、Jira 自動化キューに累積されるイベントを処理します。サードパーティのアプリが原因で、これらすべてのスレッドが「BLOCKED」または「TIMED_WAITING」の状態になり、実行を停止する場合があります。
To check if this root cause might be relevant, go to Jira automation: The automation executor threads are stuck because of the usage of a third-party app.
Root cause 8: Rules configured with the "Field value changed" trigger aren't triggered due to the "Field Security Plugin for Jira" app
サードパーティ アプリの Field Security Plugin for Jira は、監視対象のフィールドが更新されたときに、[フィールド値の変更時] トリガーを使用する自動化ルールのトリガーを妨げる場合があります。この根本原因が関連しているかどうかを確認するには、「Jira 自動化: [フィールド値の変更時] トリガーを使用する自動化ルールがトリガーされないことがある」を参照してください。
根本原因 9: 「複数の課題イベント」トリガーで構成されたルールが、イベントが別のルールによって公開された場合、トリガーされない
この根本原因が関連しているかどうかを確認するには、次の点をご確認ください。
- 影響を受けるルールのタイプは、複数の課題イベントトリガーで構成されたルールだけです。
- The impacted rules are already configured with the Allow Trigger option ticked (allowing other rules to trigger these rules).
- これらのルールをトリガーするイベントは、他の自動化ルールによって公開されたものです。
- The rules that are publishing the event do not have the checkbox Publish newer style 'IssueEventBundle' select in the Publish Event action.
上記のすべての点が確認されれば、この根本原因が関連していて、JIRAAUTOSERVER-910 - 課題情報を取得中... ステータスというバグに直面しています。
この問題を解決するには、イベントを公開するすべてのルールの [イベントを公開する] アクションで [新規スタイル「IssueEventBundle」を公開する] を選択します。
根本原因 10 - 同じイベントによって複数のルールがトリガーされ、そのうちの 1 つが完了するまでに 5 分以上かかる
同じイベントによって複数のルールがトリガーされた場合、Jira 自動化は各ルールを 1 つずつループしてイベントを処理します。イベントを処理しているルールの 1 つが完了するまでに 5 分以上かかると、次のことが起こります。
- イベントがキャッシュからクリアされる (Jira 自動化が 5 分以上アクセスされていないイベントをキャッシュから自動的にクリアするため)
Jira ログに以下の例外が記録される
2023-11-07 09:59:18,905+0100 automation-rule-executor:thread-3 ERROR some_user [c.c.j.p.a.service.execution.JiraThreadLocalExecutor] Unexpected error in thread local executor with actorKey 'some_user'. java.lang.IllegalStateException: There is no execution wih id=TenantExecution{tenantExecution=TenantExecution{tenantContext=TenantContext{environment=prod, clientKey='com.codebarrel.tenant.global', tenantId=TenantId{id='00000000-0000-0000-0000-000000bbbbbb'}}, executionUuid='c463420f-d3ae-41cb-9f4c-7d0122769999'}, auditItemId='10360381'} at com.codebarrel.automation.api.execution.DefaultExecutionFinishSynchronizer.lambda$gerRuleInfo$2(DefaultExecutionFinishSynchronizer.java:108)
- Jira automation exits the loop even though there were still some rules left to process the event
- 最終的に、一部のルールがイベントで見逃され、トリガーされない
This behavior was identified as a bug and reported in JIRAAUTOSERVER-946 - Getting issue details... STATUS
この根本原因が該当するかを確認する方法
- Check if the event that was missed by some automation rules was processed by at least another automation rule that took more than 5 minures to complete (automation rule execution times can be seen in the "Duration" column of the audit logs)
- Jira アプリケーション ログに上記の例外があるかどうかを確認する
残念ながら、次の方法以外に、このバグの簡単な回避策はありません。
- Identify which rule is taking more than 5 minutes to process the event that was missed by other rules.
- 次に、このルールを無効にするか、5 分以内で完了できるように最適化する。
根本原因 11: ルールが「複数の課題イベント」トリガーを使用して設定されており、間違ったイベントが選択されている
If a rule is configured with the trigger Multiple issue events, it's important to select the right event that this rule should be triggered on. For example, if this rule is configured to react to the event "Issue Updated", and you expect the rule to be trigger when an issue is transition to a new status, then the event figured by that transition needs to be the same event the rule is configured with.
この根本原因が該当するかを確認する方法
- ルール構成に移動して、[複数の課題イベント] トリガーが設定されているイベントを確認します。
- このルールをトリガーできなかった Jira 課題で使用されたワークフローに移動し、この Jira 課題に使用したトランジションを確認し、このトランジションで構成された事後操作のリストを確認する。
- このトランジションによって発生するイベントを確認する。
- If the event fired by the transition doesn't match the event the rule is listening, then this root cause is relevant.
- In such case, either edit the workflow transition or the automation rule trigger so that both events match.
根本原因 12: ルールが "SLA しきい値違反時" トリガーを使用して設定されている
SLA しきい値違反時トリガーを使用してルールが構成されている場合、Jira Service Management リクエストの SLA が営業日の終了時ぴったりに停止すると、ルールがトリガーされない可能性があります。
This behavior was reported as a bug in https://jira.atlassian.com/browse/JIRAAUTOSERVER-188, and was fixed in Jira Software and Jira Service Management 10.1.0.