自動化スマート値 - 条件ロジック

The smart values listed on this page can be used with actions where text fields are involved, such as the Add comment or Send email actions. They can be used to print outputs based on conditional logic such as if or and statements.

_

構文

  • {{if(smartValue)}} は true または null を返します。

  • {{if(“string”)}} は true または null を返します。

  • {{if(smartValue)}}Hello{{/}}Hello または null を返します。

  • {{if(smartValue, “Hello”)}}Hello または null を返します。

  • {{if(smartValue, "value if true", "value if false")}} では、条件が一致しない場合に特定の値を追加できます。

Let’s say you have a list of issues (perhaps from a Lookup issues action), and you want to add a comment to any that have linked issues. You could use the Add comment action with the following input to add a comment to each issue that has at least one linked issue:

{{#if(not(issue.issuelinks.isEmpty))}} This bug has {{issue.issuelinks.size}} related tickets {{/}}

この場合は、1 つの課題に 4 つの関連する課題があると、This bug has 4 related tickets というコメントが追加されます。

指定の値に等しい

構文

  • {{equals("string1", "string2")}} は、2 つの入力が等しい場合は true を、そうでない場合は false をそれぞれ返します。

  • {{equals(smartValue1, smartValue2)}} は、2 つの入力が等しい場合は true を、そうでない場合は false をそれぞれ返します。

Let's say you have a process in your team, whereby the assignee and the reporter must be different team members for auditing purposes. You could use the Add comment action with the following input to add a comment to each issue to remind your team that this is the case:

{{#if(equals(issue.assignee, issue.reporter))}} Assign this issue to someone else so they can review. {{/}}

これにより、担当者と報告者が同じ場合に、Assign this issue to someone else so they can review というコメントが追加されます。

存在する

構文

  • {{exists(smartValue)}} は true または null を返します。

  • {{exists("string")}} は true または null を返します。

たとえば、Designer という課題に関するカスタム フィールドがあるとします。テキストを追加するアクション (コメントの追加や Slack メッセージの送信など) を使用して、以下の入力をユーザーに通知できます。

{{#if(exists(issue.designer))}} The designer for this issue is {{issue.designer.displayName}} {{/}}

この場合は [Designer] フィールドに値が含まれていると「The designer for this issue is (設計者の名前)」と出力されます。

NOT

構文

  • {{not(smartValue)}} は true または false を返します。

Let’s say you have a list of issues (perhaps from a Lookup issues action), and you want to add a comment to any that have linked issues. You could use the Add comment action with the following input to add a comment to each issue that has at least one linked issue:

{{#if(not(issue.issuelinks.isEmpty))}} This bug has {{issue.issuelinks.size}} related tickets {{/}}

ここでは、スマートでない値が、ある課題に関連する課題が少なくとも 1 つあるかどうかを確認します。たとえば、1 つの課題に関連する課題が 4 つあると、This bug has 4 related tickets というコメントが追加されます。

および

構文

  • {{and(smartValue1, smartvalue2)}} は true または false を返します。

[Votes] カスタム フィールドを含む課題のリストがあるとします。[コメントを追加] アクションを使用して、100 票超 150 票未満のすべての課題にコメントを追加できます。

{{#if(and(issue.Votes.gt(100),issue.Votes.lt(150)))}} Moderately Popular issue {{/}}

この入力によって、Moderately Popular issue というコメントが追加されます。

または

構文

  • {{or(smartValue1, smartvalue2)}} は true または false を返します。

顧客がバグをレポートするために使用するプロジェクトがあり、課題に [Votes] というカスタム フィールドがあるとします。[課題を検索] アクションを使用して課題のリストを収集し [コメントを追加] アクションを使用して、100 票を超えるかコメントが 20 件を超えるすべての課題にコメントを追加できます。

{{#if(or(issue.Votes.gt(100),issue.comments.gt(20)))}} Heavily requested issue {{/}}

ここで、if スマート値が 100 票を超えるか 20 件のコメントを超えているものを確認して、Heavily requested issue というコメントを追加します。

 

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

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