# Introducing WHEN -> THEN clauses

The [**Ultimate Validator**](https://docs.forgappify.com/workflow-building-blocks-for-jira/conditions-validators/ultimate) has been upgraded to make it easier than ever to require fields conditionally, based on issue content.

This feature simplifies common scenarios such as:

* Making a field required **only if another field has a certain value**.
* Making **different groups of fields** required depending on the option selected.
* Enforcing checkbox selection (e.g. *consent checkbox*) based on answers provided.

### Why **WHEN → THEN** Clauses?

Previously, you could use the **OR** operator to simulate conditional logic. While functional, it required “reversing” the logic, which was not intuitive.

**Example – old approach (using OR):**

* FieldA = single select.
* FieldB should be required if optionB is selected in FieldA .
* To configure this, you would:
  1. Check whether *optionB* is **not** selected.
  2. OR, if it is selected, check whether FieldB is not empty.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FjVdfuV6KVLtemsBPVa7O%2Fwhen_then_0_back.png?alt=media&#x26;token=d098865f-6035-4b43-801c-59c19c05ccc6" alt="Jira Ultimate Validator setup example showing old approach to make a field required conditionally using OR logic"><figcaption></figcaption></figure>

This works because the second clause (mandatory field) is only checked when the first clause is false. However, the logic is reversed, which makes it harder to read.

### The New Approach: **WHEN → THEN**

With WHEN → THEN clauses, the same case can now be expressed naturally:

1. When optionB is selected
2. Then require FieldB to be not empty

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FYTe3PsQtDNw5skuRAUOu%2Fwhen_then_1_back.png?alt=media&#x26;token=332ef9fc-dc91-45de-8abd-6e409d80a03b" alt="Jira Ultimate Validator setup example showing new approach to make a field required conditionally using When-Then logic"><figcaption></figcaption></figure>

Conditions separated by a **THEN** connector are wrapped in parentheses, allowing you to safely combine multiple requirements.

**Example – multiple options:**

* Make two fields (FieldB, FieldC) mandatory if optionB **or** optionC is selected.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FdU2gA192PoetU97KdxSe%2Fwhen_then_2_back.png?alt=media&#x26;token=524a4335-4d52-438c-8e38-89c66bd1c8e8" alt="Jira Ultimate Validator setup example showing new approach to make a field required conditionally using When-Then logic, where AND and OR conditions can be safely used between Then blocks"><figcaption></figcaption></figure>

### **AND WHEN** Clauses

For more complex scenarios, you can chain multiple conditional blocks with **AND WHEN**.

**Example – different fields required for different options:**

1. FieldB is required WHEN optionB is selected.
2. FieldC is required WHEN optionC is selected.
3. FieldE is required WHEN optionD **or** optionE is selected.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FYIIMGGLmh60MgsKi9fsx%2Fwhen_then_3_back.png?alt=media&#x26;token=08c4610a-5e45-4dab-8ad0-41fcdd9fa29d" alt="Jira Ultimate Validator example showing how different sets of fields can be made required based on the selection of different options using When-Then logic"><figcaption></figcaption></figure>

With Ultimate Validator, you can combine all your field requirements into a single workflow validator or condition, making complex validations simple and easy to manage.

### Jira Expression Preview

At the bottom of the configuration screen—just like in all our validators—you’ll find the **Jira Expression Preview** panel. This shows the exact Jira Expression generated from your setup, so you can confirm the validator does what you expect.
