Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

オートメーション機能についての質問です。

mokupuni919 April 23, 2024

お世話になっております。

毎日定時にSlackチャンネルメッセージを自動で通知しようと思っているのですが、実現できないことがあり質問させてください。

【実現したいこと】

期限が[本日]かつステータスが[A]または[B]という条件で JQL検索をして、検索結果の課題件数が0件の場合にはSlackチャンネルに「本日のリリースはありません」という旨のメッセージを通知する。

JQL検索結果が0件でない場合、期限が[本日]かつステータスが[A]という条件で 2回目のJQL検索をして、検索結果の課題件数が0件の場合にはSlackチャンネルに「本日期限の課題はマージ済です。リリースを進めてください。」という旨のメッセージを通知する。

2回目の JQL検索結果の課題件数が0件でない場合にはSlackチャンネルに「本日期限の課題は〇〇件です」という旨のメッセージを通知する。

 

【試したこと・詰まっていること】

ルールビルダーで以下のように設定。

1. トリガー「スケジュール時」に設定

2. アクション「課題を検索」を選択して、 JQLを入力

3. If/Else条件ブロックを追加して、Ifの条件には、 {{lookupIssues.size}} が 0 と等しい を設定、Slackチェンネルメッセージ送信の設定を行う。

4. Elseには、アクション「課題を検索」を選択して、 JQLを入力

 

その次に If/Else条件ブロックのコンポーネントを追加したいのですが、選択項目に「条件を追加」がなく、「アクションを追加する」「ブランチを追加」しか選べず詰まっています。

 

やりたいことは4.の次に、If/Elseの条件分岐を追加して、Ifの条件には {{lookupIssues.size}} が 0 と等しい を設定、その後Slackメッセージを送信の設定を行い、Elseの場合にはSlackメッセージを送信の設定を行いたいです。

 

上記の実現したいことをJira Software (Cloud)のオートメーション機能を用いて設定可能でしょうか。

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2024

Hi @mokupuni919 -- Welcome to the Atlassian Community!

Automation rules cannot have nested if / else conditions, where one is inside of another.

There are three alternatives to solve the scenario you describe:

  1. Review the JQL for your different queries to determine if it can be merged in such a way that there are only two cases and not three
  2. Split the scenario into two rules, where the second rule does not use if / else for the first condition...but instead only uses a simple condition on the lookup issues action returning no issues
  3. A more complicated solution is to perform the first lookup issues query, and save the results in a lookup table.  Then perform the second lookup issues query, ignoring the results of the first one.  Finally, using a single if / else block all three conditions can be tested, one after another.

Kind regards,
Bill

mokupuni919 April 25, 2024

Thanks Bill, it's very useful to know that i can't use nested if / else conditions.

I don't feel I can solve the problem immediately, but I will try to use the advice I received.

0 votes
NTAMEN NTANMI luc landry
Contributor
April 24, 2024

こんにちは、ようこそ @mokupuni919

コミュニティ 。実際、Jira の条件構造は理解して設定するのが簡単ではありません。

必要なのは、同じトリガーを持つ、JQL 検索レベルで異なる条件を持つ複数のルールを作成することです。

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events