Jira 自動化でスマート値を書式設定する
スマート値を使用すると、Jira で課題データにアクセスして操作できます。スマート値をカスタマイズする場合は、異なる書式設定を選択できます。
スマート値の使用方法
You can use smart values to save time and effort, by instantly inserting data into your automation flows, such as names, timezones, and other information. For example:
スマート値
{{now.plusDays(5)}}は、現在の日付と、それに 5 日間を追加したものを返します。スマート値
{{issue.summary}}は、選択した課題の要約を返します。
Let’s look at an example of how smart values can be used in the automation flow builder. Say you wanted to add a comment to an issue once it is transitioned to ‘In Progress’, and in this comment, you want to address the reporter and assignee of this issue by name. All you need to do is insert the right smart values in the appropriate places in your comment:
スマート バリューをフォーマットする
Smart values use the Mustache library, preventing arbitrary code execution. To make a substitution, you need to wrap the value in double curly brackets. For example, {{examplevalue}}.
子要素を参照する場合は、値にピリオドを含める必要があります。(例: {{issue.key}})。
課題フィールドへのアクセス
課題フィールドにアクセスするには、フィールド名 {{issue.My custom field name}} を使用します。
フィールドがオブジェクトの場合は、その中の値を参照します。たとえば、ユーザー カスタム フィールドの場合は次のようにします。
{{issue.My user field.displayName}}Field names aren’t case sensitive and are translated using your flow actor's language setting. If you're trying to access custom fields with translated names in your smart values, then you need to use the language set for your flow actor user.
同名のカスタム フィールドが複数ある、またはカスタム フィールドがシステム フィールドと同名の場合は、カスタム フィールド ID も使用できます。例:
{{issue.customfield_10001}}See Accessing issue fields for more detailed information.
セクションとリストに # を使用する
複数の項目を反復処理するには、スマート値で取り込まれたすべての項目に対して同じアクションを生成する # を使用できます。# を使用する場合は、最後に必ず {{/}} をつける必要があります。下の例では、アクションはコメント作成者のリストを表示します。
{{#issue.comments}}Author: {{author.displayName}}{{/}}To treat items as a number when using math functions, use {{#=}}. For example, to perform a simple calculation to add 100 to an "Invoice Amount" custom field on your issue, you can use:
{{#=}}{{issue.Invoice Amount}} + 100{{/}}デフォルト値
フィールドまたは値が存在しない場合は通常、空の値 ({{invalid reference}}) を返します。
値が必要な場合は、既定値を指定できます。たとえば、「invalid reference」に値が含まれていない場合は、{{invalid reference|Hello world}} とすると「Hello world」を表示できます。
利用可能なスマート値の詳細
この内容はお役に立ちましたか?