フォームやフォーム フィールドでスマート値にアクセス
送信されたフォームやフォーム フィールドのスマート値にアクセスすることで、Jira Service Management でデータを取得して操作するだけでなく、自動化やレポート機能を強化することもできます。
アクセスできるスマート値は、送信されたフォームのトリガーに使用されたフォームのものに限られます。
スマート値でフォームを取得する
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 flow. To access a specific form from a list, use the automation lists smart values to retrieve the form you’re after.
スマート値でフォーム フィールドを取得する
フォーム フィールドの特定のスマート値にアクセスするには、フィールド タイプと、フォーム内のフィールドの一意の識別子として機能するフィールド キーの両方を把握している必要があります。各フィールドのフィールド キーは、サイド パネルからフォームでフィールドを設定する際にカスタマイズできます。
なお、フィールド キーは大文字と小文字を正しく区別して入力する必要があります。スペースも同様に認識されます。
Example automation flow
John wants to create an automation flow that adds a comment with onboarding notes whenever an ‘Employee Onboarding’ form is submitted.
Before he creates this flow, he needs to make sure the ‘Notes’ field in the ‘Employee Onboarding’ form has a field key.
彼はこれを「onboarding-notes」にします。
He navigates to Automation to create this flow, and uses the trigger Form submitted with ‘Employee Onboarding’ selected as the form.
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 flow.
短いテキスト
長いテキスト
段落
メール
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 flow. 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 flow.
日付
日時
時間
例
日付フィールド キーが "期限" で、選択フィールドの選択値が "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 flow.
数値
例
数値フィールド キーが "インボイス" で、フィールドの値が "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 flow.
単一ユーザー
複数のユーザー
例
ユーザー フィールド キーが "マネージャー" で、ユーザー フィールドの値が "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 flow. 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.
Example automation flow
John wants to create an automation flow that adds a comment with an employee’s latest salary to a work item.
Before he creates this flow, he needs to make sure the ‘Salary’ field in the ‘Payroll setup’ form has a field key.
彼はこれを「payroll-salary」にします。
He now navigates to Automation to create this flow 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.
この内容はお役に立ちましたか?