自動化で検索アクションとルックアップ アクションを使用する
カードの検索
カード ボタンを選択するかカードの変更に反応するルールをトリガーすることで自動化を実行すると、自動化のアクション (ラベルの追加やコメントの投稿など) がトリガーの発生したカードで発生します。このカードはトリガー カードと呼ばれます。
他のカードに変更を加えるか情報を他のカードから取得する自動化が必要な場合は、find と lookup の各アクションを使用できます。これらのアクションは、ルール、カード ボタン、期限の各自動化の [カスケード] タブで利用できます。
例 1
次のルールは、ボードにメールで送信されたすべてのカードを同名のカードにリンクします (そのようなカードがボード上に存在する場合)。この自動化では、ボードにメールで送信されたカードがトリガー カードです。
when a card is emailed into the board, find a card titled "{cardname}", and link the cards together
例 2
次の自動化では、カードの添付ファイルに別のカードがリンクされています。最初のカードが [完了] リストに移動すると、リンクされたカードの同じリストへの移動が開始されてカスケード効果が発生します。[完了] リストに移動したカードがトリガー カードです。
when a card is moved to list "Done", find the first card linked in the attachments, and move the card to list "Done"
However, when you find another card, that card becomes the current card, and all actions going forward will occur on that card. In this case, if you use card variables in your automation (such as {cardname}
, {carddescription}
, or {cardduedate}
), they will refer to the found card, since it's the current card.
To refer to the content of the trigger card, you need to use card variables with the trigger prefix like {triggercardname}
, {triggercarddescription}
, or {triggercardduedate}
. For example, each time you add a card to a list, you can also add a link to the trigger card as an item in a checklist in another card:
when a card is added to list "Doing" by me, find a card titled "Rollup", and add item "{triggercardlink}" to checklist "Doing"
カードのルックアップ
注: Trello では、ルックアップ アクションを一般的なデータベーススタイルの機能として使用しないでください。ルックアップ テーブルを何千枚ものカードで作成すると、パフォーマンスが低下します。
別のカードを検索するが現在のカードで引き続き作業する場合は、lookup アクションを使用できます。これは find アクションと同じように使用できますが、現在のカードを変更しません。
You can refer to the found card by using card variables with the found prefix. For example, {foundcardname}
, {foundcarddescription}
, and {foundcardduedate}
.
例 1
たとえば、カスタム フィールド「Priority」を他の 2 つのカスタム フィールド「Scope」と「Impact」の値に従って設定するとします。「Scope」が Small で「Impact」が High の場合は「Priority」を P1 に設定しますが、「Scope」が Small で「Impact」が Low の場合は「Priority」フィールドの値を P3 に設定します。
これには多数のルールが必要ですが、ルックアップ アクションによってカードを組み合わせごとに作成できます。
リスト「Priority lookup」を作成します。
カード「Small, High」を追加して、説明「P1」を追加します。
カード「Small, Low」を追加して、説明「P3」を追加します。
自動化ルックアップを実行するための 2 つの自動化ルールを作成します。
when custom field "Scope" is set by anyone, lookup a card titled "{{%Scope}}, {{%Impact}}" in list "Priority lookup", and set custom field "Priority" to "{foundcarddescription}"
when custom field "Impact" is set by anyone, lookup a card titled "{{%Scope}}, {{%Impact}}" in list "Priority lookup", and set custom field "Priority" to "{foundcarddescription}"
ボードのユーザーのいずれかが「Scope」と「Impact」の各カスタム フィールドを設定すると、自動化は「Priority」カスタム フィールドを自動で設定します。
例 2
一部のデータを計算するためにカードのルックアップを実行する場合があります。たとえば「State」、「Tax」、「Item Cost」などの他のカスタム フィールドの値に従って「Final Price」カスタム フィールドを設定することで、各州における製品の最終価格を計算できます。
さまざまな組み合わせのカードを作成できます。
リスト「Costs」を作成します。
カード「Texas」を追加して、税率 (小数) の説明を含めます。例: 0.062 (6.2%)
計算を実行するための 2 つの自動化ルールを作成します。
when custom field "State" is set by anyone, lookup a card titled {customfieldvalue} in list "Costs", and set custom field "Tax" to "{foundcarddescription}"
when custom field "Item Cost" is set by anyone, set custom field "Final Price" to "({{%Tax}} * {{%Item Cost}}) + {{%Item Cost}}"
Note: The preceding rule includes the custom field arithmetic to do the calculation. You can perform basic arithmetic operations such as addition, subtraction, multiplication, and division when setting the "Number" custom field.
ボードのユーザーのいずれかが「State」を「Texas」に設定して製品価格を「Item Price」カスタム フィールドに入力すると、自動化は「Final Price」カスタム フィールドを自動で設定します。
この内容はお役に立ちましたか?