リストにおけるスマート バリューの使用例
Jira Automation テンプレート ライブラリでスマート バリューを使用する方法をご確認ください。
スマート バリューを使用して、複数のオプション リストの項目 (チェックボックス、ラベル、マルチ選択リストなど) にアクセスし、値をフォーマットできます。
View the smart values available to access and format lists.
例
You have a checkbox list called Sydney attractions with the following options: Harbour Bridge, Opera House, Bondi Beach. There are a number of different ways to use smart values to format this list.
// Simplest way to show a comma separated list of values
{{issue.Sydney attractions.value}}
Harbour Bridge, Opera House, Bondi Beach
// Display attractions separated with a dash
{{#issue.Sydney attractions}} {{value}}{{^last}}- {{/}}{{/}}
Harbour Bridge - Opera House - Bondi Beach
// Now separated by space
{{#issue.Sydney attractions}}{{value}} {{/}}
Harbour Bridge Opera House Bondi Beach
// OR
{{issue.Sydney attractions.value.join(" ")}}
Harbour Bridge Opera House Bondi Beach
以下のフィールド タイプは、.value
を使用して、人が判読可能なラベルにアクセスします (.id
にもアクセスできます)。
選択リスト
複数選択リスト
カスケード選択リスト
ラジオ ボタン
複数選択ボックス
複数ユーザー選択機能
マルチユーザー ピッカーは、他のマルチ選択フィールドと似た働きをしますが、すべてのユーザー属性への完全なアクセス権がある点で異なります (例 .displayName
)。
例
You have a multi-user picker called users with the following options: John Smith, Jack Brown and Jill Jones. Smart values can be used to access and format the users in this list.
// Show only their names
{{issue.users.displayName}}
John Smith, Jack Brown, Jill Jones
// Show names with emails
{{#issue.users}}{{displayName}} ({{emailAddress}}) {{/}}
John Smith (john@smith.com) Jack Brown (jack@brown.com) Jill Jones (jill@jones.com)
この内容はお役に立ちましたか?