• Get started
  • Documentation

Access smart values for forms and form fields

Access smart values on submitted forms and form fields to not only retrieve and manipulate data in Jira Service Management, but also power automations and reporting.

Only smart values on forms that use the form submitted trigger can be accessed.

Retrieve forms with smart values

You can access submitted forms on issues 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 retrive the form you’re after.

Example
If the last form in a list of submitted forms on an issue is ‘Onboarding checklist'; {{forms.last}} will return ‘Onboarding checklist’

Retrieve form fields with smart values

To access a specific smart value of a form field, you’ll need to know both the field type and the field key which acts as the unique identifier of a field in a form. You can customize a specific field's field key when configuring your fields in forms from the side panel.

Field keys are case-sensitive so need to be entered correctly. This also includes any spaces.

Example automation rule

John wants to create an automation rule that adds a comment with onboarding notes whenever an ‘Employee Onboarding’ form is submitted.

Before he creates this rule, he needs to make sure the ‘Notes’ field in the ‘Employee Onboarding’ form has a field key.

He makes this ‘onboarding-notes’.

He navigates to Automation to create this rule, and uses the trigger Form submitted with ‘Employee Onboarding’ selected as the form.

He then adds the action Comment on issue 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 issue.

Text fields

The following field types use the automation text field smart values and format the value as a text string when setting up a rule.

  • Short text

  • Long text

  • Paragraph

  • Email

  • URL

Example
If the value in a text field with the field key Summary is ‘Jane Doe’; {{forms.last.Summary}} will return ‘Jane Doe’

Choice fields

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}}.

  • Radio buttons

  • Checkboxes

  • Dropdown

  • Multiselect dropdown

  • Cascading dropdown

  • Assets

Example
If the selected value in a choice field with the field key Location is ‘Sydney’; {{forms.last.Location.label}} will return ‘Sydney’

Date fields

The following field types use the automation date and time smart values and format as text values when setting up a rule.

  • Date

  • Date & Time

  • Time

Example
If the selected value in a date field with the field key Due date is ‘10/01/24’; {{forms.last.Due date.fullDate}} will return ‘Wednesday, October 1, 2024’

Number fields

The following field types use the automation math expressions smart values and format as numerical values when setting up a rule.

  • Number

Example
If the value in a number field with the field key Invoice is ‘100’; {{forms.last.Invoice.asCurrency}} will return ‘$100’

User fields

The following field types use the automation users smart values and format as user data when setting up a rule.

  • Single user

  • Multiple users

Example
If the value in a user field with the field key Manager is ‘John Doe’; {{forms.last.Manager.displayName}} will return ‘John Doe’

Attachment field

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}}.

  • Attachment

Example
If the value in an attachment field with the field key Upload resume is named ‘Jane Doe CV’; {{forms.last.Upload resume.name}} will return ‘Jane Doe CV’

Access smart values without using the Forms submitted trigger

You can also access any forms on an issue 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 rule

John wants to create an automation rule that adds a comment with an employee’s latest salary to an issue.

Before he creates this rule, he needs to make sure the ‘Salary’ field in the ‘Payroll setup’ form has a field key.

He makes this ‘payroll-salary’.

He now navigates to Automation to create this rule and selects the Manual trigger from issue as the trigger.

He then adds the action Comment on issue and enters {{issue.forms.f7142b07-d3a4-4522-a7e4-8799d526e0a6.payroll-salary}} as the comment.

Now whenever multiple ‘Payroll setup’ forms are on an issue, the value from the ‘Salary’ field on the most recent ‘Payroll setup’ form will be added as a comment on the issue.

Still need help?

The Atlassian Community is here for you.