On this page

Use case

Evaluate custom fields of different types with Jira expressions.



Add a Jira expression validator or a Jira expression condition to the transition of your choice

Fields

Follow the instructions to evaluate any type of custom field depending on your preference.

For every example, the expression editor must be set to Jira expression and the field code IDs must be replaced.

Jira expression*

new Date() < new Date(issue?.customfield_nnnnn)

The selected date and time is posterior to the current date and time.

Jira expression*

new Date().toCalendarDate() < new CalendarDate(issue?.customfield_nnnnn)

The selected date must be posterior to the current date.

Jira expression*

issue?.customfield_nnnnn?.value != null

The field must not be empty.



Jira expression*

issue?.customfield_nnnnn?.value == "Option 01"

The selected option must be a specific value.



Jira expression*

["Option 01", "Option 02"].includes(issue?.customfield_nnnnn?.value)

The field must contain one of two specific values.



Jira expression*

issue?.customfield_nnnnn?.map(c => c.value).includes("Option 01")

One of the options values must be a specific value.

Jira expression*

issue?.customfield_nnnnn?.length > 2

More than two values must be selected.

Jira expression*

issue?.customfield_nnnnn?.every(c => c.value.match('Option 01'))

Only a specific value must be selected.

Jira expression*

issue?.customfield_nnnnn != null

The field must not be empty.

Jira expression*

issue?.customfield_nnnnn?.value == "Option 01"

The parent value must be a specific value.

Jira expression*

issue?.customfield_nnnnn.child?.value == "One"

The child value must be a specific value.

Jira expression*

issue?.customfield_nnnnn?.value == null && issue?.customfield_nnnnn.child?.value != null

The parent value must be empty and the child value must not be empty.

Jira expression*

issue?.customfield_nnnnn == "This is a text"

The field value must match exactly a text.

Jira expression*

issue?.customfield_nnnnn.includes("is a text")

The field value must contain a text.

Related examples

JWT feature

Workflow function

Jira expression condition

Jira expression validator

Use case description

Evaluate custom fields of different types with Jira expressions.

This use case is valid for both conditions and validators. The only difference is that you can specify an additional error message when using a validator.

Complexity