フォームやフォーム フィールドでスマート値にアクセス
送信されたフォームやフォーム フィールドのスマート値にアクセスすることで、Jira Service Management でデータを取得して操作するだけでなく、自動化やレポート機能を強化することもできます。
Only smart values on forms that use the form submitted trigger can be accessed.
スマート値でフォームを取得する
You can access submitted forms on work items when using the Forms submitted automation trigger by using {{forms}} to format the value of forms in a list when setting up a rule. To access a specific form from a list, use the automation lists smart values to retrieve the form you’re after.
スマート値でフォーム フィールドを取得する
フォーム フィールドの特定のスマート値にアクセスするには、フィールド タイプと、フォーム内のフィールドの一意の識別子として機能するフィールド キーの両方を把握している必要があります。各フィールドのフィールド キーは、サイド パネルからフォームでフィールドを設定する際にカスタマイズできます。
なお、フィールド キーは大文字と小文字を正しく区別して入力する必要があります。スペースも同様に認識されます。
自動化ルールの例
ジョンは、「従業員オンボーディング」フォームが送信されるたびに、オンボーディング メモ付きのコメントを追加する自動化ルールを作成したいと考えています。
このルールを作成する前に、「従業員オンボーディング」フォームの「メモ」フィールドにフィールド キーがあることを確認する必要があります。
彼はこれを「onboarding-notes」にします。
[自動化] に移動してこのルールを作成し、フォームとして「従業員オンボーディング」を選択した状態でトリガー [フォームの送信時] を使用します。
He then adds the action Comment on work item and enters {{forms.last.onboarding-notes}} as the comment.
Now whenever an ‘Employee Onboarding’ is submitted, the value from the ‘Notes’ field will be added as a comment on the work item.
テキスト フィールド
The following field types use the automation text field smart values and format the value as a text string when setting up a rule.
短いテキスト
長いテキスト
段落
メール
URL
例
テキスト フィールド キーが "要約" で、テキスト フィールドの値が "Taro Yamada" の場合、{{forms.last.Summary}} は "Taro Yamada" を返します。
選択肢フィールド
The following field types use the automation lists smart values and format the value of items in a list when setting up a rule. To retrieve the id of a selected choice use {{id}} and to retrieve the label of a selected choice use {{label}}.
ラジオ ボタン
チェックボックス
ドロップダウン
複数選択ドロップダウン
カスケード ドロップダウン
Assets
例
フィールド キーが "所在地" で、選択肢フィールドの選択値が "シドニー" の場合、{{forms.last.Location.label}} は "シドニー" を返します。
日付フィールド
The following field types use the automation date and time smart values and format as text values when setting up a rule.
日付
日時
時間
例
日付フィールド キーが "期限" で、選択フィールドの選択値が "10/01/24" の場合、{{forms.last.Due date.fullDate}} は "2024 年 10 月 1 日水曜日" を返します。
数値フィールド
The following field types use the automation math expressions smart values and format as numerical values when setting up a rule.
数値
例
数値フィールド キーが "インボイス" で、フィールドの値が "100" の場合、{{forms.last.Invoice.asCurrency}} は "$100" を返します。
ユーザー フィールド
The following field types use the automation users smart values and format as user data when setting up a rule.
単一ユーザー
複数のユーザー
例
ユーザー フィールド キーが "マネージャー" で、ユーザー フィールドの値が "Taro Yamada" の場合、{{forms.last.Manager.displayName}} は "Taro Yamada" を返します。
添付ファイル フィールド
The following field types use the automation lists smart values and format the value of items in a list when setting up a rule. To retrieve the id of an attachment use {{id}} and to retrieve name of an attachment use {{name}}.
添付ファイル
例
添付ファイル フィールド キーが "履歴書アップロード" で、フィールドの値が "Taro Yamada CV" の場合、{{forms.last.Upload resume.name}} は "Taro Yamada CV" を返します。
[フォームの送信時] トリガーを使用せずにスマート値にアクセスする
You can also access any forms on a work item by using {{issue.forms.<UUID>}} and referring to automation lists smart values. These will be grouped by their Universally Unique Identifiers (UUIDs) and be returned as a list. The UUID can be retrieved from either the Forms REST APIs 'Get project form index', or by inspecting elements on the Forms landing page and accessing the UUID via the Network tab.
自動化ルールの例
John wants to create an automation rule that adds a comment with an employee’s latest salary to a work item.
このルールを作成する前に、「給与設定」フォームの「給与」フィールドにフィールド キーがあることを確認する必要があります。
彼はこれを「payroll-salary」にします。
He now navigates to Automation to create this rule and selects the Manual trigger from work item as the trigger.
He then adds the action Comment on work item and enters {{issue.forms.f7142b07-d3a4-4522-a7e4-8799d526e0a6.payroll-salary}} as the comment.
Now whenever multiple ‘Payroll setup’ forms are on a work item, the value from the ‘Salary’ field on the most recent ‘Payroll setup’ form will be added as a comment on the work item.
この内容はお役に立ちましたか?