Compare two values validator

This validator evaluates the comparison of two (field) values. 

🛠️ Configuration

Notes

You can optionally enter a short Note (limited to 80 chars) and a longer Explanation (limited to 500 chars) to summarize what you are using the function for. This can help you differentiate multiple functions of the same kind in a single transition, as the Note will be shown in the workflow transition view.

Field

Define the first of the two values that should be compared by selecting it from the list of available fields.

Depending on the type of the field you have selected only certain operators and fields in the comparison value selector are available.

Operator

Select how to compare the two given values. Choose from one of the following operator options:

Operator

Description

=

The first value must be equal to the second value.

!=

The first value must not be equal to the second value.

<

The first value must be less than the second value. This is typically used for comparing numeric or date-time values.

>

The first value must be greater than the second value. This is typically used for comparing numeric or date-time values.

<=

The first value must be less than or equal to the second value. This is typically used for comparing numeric or date-time values.

>=

The first value must be greater than or equal to the second value. This is typically used for comparing numeric or date-time values.

~

The first value must contain the second value. This is typically used for lists as field value to compare. The comparison value is a text or number.

!~ 

The first value must not contain the second value. This is typically used for lists as field value to compare. The comparison value is a text or number.

In case you have selected a field of the type list  or text , only the equal, not equal, contains and not contains operators are available.
For fields of type  boolean , only the equal and not equal operators are available.

Comparison value

Define the second of the two values that should be compared either by selecting it from the list of available fields or by entering a literal value. You can switch between the two option by using the radio button which offers the options

  • "Select the field to compare the value with." This is the preselected default value.

  • "Enter the custom comparison value." In this case a text editor opens where you can enter the comparison value manually.
    Depending on the data type of the first comparison value, the following inputs are valid as custom value:

Option

Description

Date

A date in the format YYYY-MM-DD, e.g. 2008-09-15

Date time 

A date time value in the format YYYY-MM-DDTHH:mm:ss, e.g. 2008-09-15T15:53:00+05:00

Text

Any text, e.g. This is a text

Number

Any number, e.g. 42 or 7.75

List 

List are entered as their comma separated values: This, is, a, list or 2,3,5,7

Boolean

One of the boolean values true or false

Select list (cascading)

The parent and child values are noted as text, separated by a comma, e.g. Parent, child. If the child is omitted (e.g. Parent) then the child value of the first operator has to be null as well.

If you need to compare multiple values or construct more complex comparisons make sure to have a look at the Jira expression validator.

If one of the selected fields is hidden or deleted when the condition is executed, the field value is interpreted as null.

Error message

Enter the message to show to the end-user when the validation fails. If you don't enter a message, the default error Message for JWT for Jira Cloud "Validation failed for validator 'Compare two values (JWT)'" is displayed in case the validation fails.

Conditonal Execution

You can optionally specify a Jira expression to define the circumstances (or conditions) under which the condition should be applied.

The result of the Jira expression must return a boolean value of either:

  • true → the condition will be applied

  • false → the condition will be ignored (i.e. the transition will be available)

Pro Tip: Use this e.g. to allow Administrators or App/Automation users to bypass normal process restrictions.

📚 Use cases

Use case Workflow function Use case description
Current user must be reporter

Compare two values condition

Compare two values validator

Current user must be reporter.

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.

Due date must be in the future

Compare two values condition

Compare two values validator

The due date must be in the future.

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.

Issue must have at least two attachments

Compare two values condition

Compare two values validator

Require a at least two attachments.

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.