How to retrieve automation rule execution count in Jira Data Center via REST API
プラットフォームについて: Data Center および Cloud (状況に応じる) - この記事はアトラシアンの Data Center プラットフォーム 向けに記述されていますが、Atlassian Cloud のカスタマーも記事の内容を利用できる可能性があります。この記事で説明されている手順の実施が役立つと考えられる場合、 アトラシアンサポートに連絡する のうえ、この記事について言及してください。
Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
要約
Sometimes it is helpful to understand how frequently a rule is executing over a certain period of time. Viewing the performance insights of automation rules in the UI does give some level of information but it is not grouped by date range and you are not able to customize the date range beyond 1h, 1d, 1w, and 1m.
You can use the REST API endpoint used by the View performance insights function to pull data over a custom date range and in the resulting JSON it will include a total of rule executions for each rule during that range.
環境
Jira Data Center
ソリューション
Copy the url below and update the <baseURL>, startTime=<yyyy-mm-dd>T00%3A00%3A00Z, and endTime=<yyyy-mm-dd>T23%3A59%3A00Z placeholders.
<baseURL>/rest/cb-automation/latest/insight/GLOBAL/rule?&startTime=<yyyy-mm-dd>T00%3A00%3A00Z&endTime=<yyyy-mm-dd>T23%3A59%3A00Z&sortField=EXECUTION_COUNT&sortOrder=DESC&limit=99例:
https://testjira.com/jira/rest/cb-automation/latest/insight/GLOBAL/rule?&startTime=2024-08-01T00%3A00%3A00Z&endTime=2024-08-08T23%3A59%3A00Z&sortField=EXECUTION_COUNT&sortOrder=DESC&limit=99Paste the url in the browser window where you are logged in to Jira.
JSON returned should include total executions, success, no actions performed, and some error quantities for all rules in the instance.
Last, we will want to execute the SQL query below to retrieve the list of automation rules, which will include the rule ID, in order to identify the execution quantity for the rule/s in question.
select "AO_589059_RULE_CONFIG"."ID", "AO_589059_RULE_CONFIG"."NAME" as "Rule Name" from "AO_589059_RULE_CONFIG"
この内容はお役に立ちましたか?