---
title: "Use cases for validators"
canonical: "https://support.appfire.com/space/JMWE/462061580/Use%20cases%20for%20validators"
format: markdown
---
> Macro (aura-html)

This section has use cases which help you in understand the usage of Validators provided by JMWE.

### Field has been modified validator

This validator can be used to block the user from progressing to a destination status unless a field has been modified.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Validate the change in Resolution provided when closing an issue</span>

<details>
<summary>Steps</summary>

- Add the `Field has been modified validator `to the **Close **transition.
- Select `Resolution` from `Field.`
</details>

#### :light_bulb_on: Validate that the Fix Version/s has been modified when the resolution is "Fixed"

<details>
<summary>Steps</summary>

- Add the `Field has been modified validator `to the **Close **transition.
- Select Fix Versions from `Field.`
- Select the `Conditional execution` section
- Input the following script:
</details>

### Field is required validator

This validator can be used to ensure that a field has a value during a transition.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Validate the Affects Version/s and Assignee fields for a non-empty value on creating a Bug.</span>

<details>
<summary>Steps</summary>

- Add the `Field is required validator `to the **Create **transition.
- Select `Affects Version/s` and `Assignee` from `Fields.`
</details>

### Comment required validator

This validator can be used to force the users to enter a comment while transitioning to destination status.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Validate that a comment is entered when rejecting a Bug fix.</span>

<details>
<summary>Steps</summary>

- Add the `Comment required validator `to the **Reject **transition of the Bug workflow.
</details>

#### :light_bulb_on:<span style="color: #172b4d"> Validate that a comment is entered when the resolution is "Won't Do"</span>

<details>
<summary>Steps</summary>

- Add the `Comment required validator `to the **Done **transition
- Select the Conditional execution option
- Input the following script:
</details>

### Field has single value validator

This validator can be used to check that a multi-valued field does not have more than one value during a transition.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Validate the Fix Version/s for a single value on an issue when the issue is fixed.</span>

<details>
<summary>Steps</summary>

- Add the `Field has single value validator `to the **Close **transition.
- Select `Fix Version/s` from `Field.`
</details>

#### :light_bulb_on:<span style="color: #172b4d"> Validate that the Component/s field has only one value if the issue type is Story</span>

<details>
<summary>Steps</summary>

- Add the `Field has single value validator `to the **Close **transition.
- Select `Component/s` from `Field.`
- Select the Conditional execution option
- Input the following script:
</details>

### Previous status validator

This validator can be used to stop the user from transitioning to a status unless the issue has previously been in a specified status in the workflow.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Block the transition of an issue to Close status if it has not been approved.</span>

<details>
<summary>Steps</summary>

- Add the `Previous status validator `to the **Close **transition.
- Select `Approved `from `Previous Status`
</details>

### Parent status validator

This validator can be used to stop the user from transitioning to a status unless the issue's parent has been in a selected status in the workflow.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Block the trigger of "Start Progress" on subtasks until its parent is approved.</span>

<details>
<summary>Steps</summary>

- Add the `Parent status validator `to the **Start Progress **transition.
- Select `Approved `from `Parent Status`
</details>

###   
Scripted (Groovy) validator

This validator can be used to perform a validation with a groovy expression. Based on the result of the expression, the user is either allowed or blocked to transition to the destination status.

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Block the creation of a Bug if no Attachment is provided.</span>

<details>
<summary>Steps</summary>

- Add the `Scripted (Groovy) validator `to the **Create **transition.
- Write the following in the `Groovy script`
</details>

#### :light_bulb_on:<span style="color: #222222"> Validate the Cascade select for values in parent and child select dropdowns</span>

<details>
<summary>Steps</summary>

- Add the `Scripted (Groovy) validator `to the transition.
- Write the following in the `Groovy script`
</details>

#### :light_bulb_on:<span style="color: #172b4d"> Block the approving of the Change request if it has no confluence page linked</span>

<details>
<summary>Steps</summary>

- Add the `Scripted (Groovy) validator `to the **Approve** transition.
- Write this content in the `Groovy script.`
  
- Type the error message in `Error message,` to display if the validation script returns `false`
</details>

#### :light_bulb_on:<span style="color: #172b4d"> Block the approval of an issue if there is no PDF attached either from before or added during the transition</span>

<details>
<summary>Steps</summary>

- Add the `Scripted (Groovy) validator `to the **Approve **transition.
- Write this content in the `Groovy script.`
  
- Type the error message in `Error message,` to display if the validation script returns `false`
</details>

### Related Issues Status validator

This validator <span style="color: #091e42">ensures that the current issue's related issues </span><span style="color: #172b4d">(such as linked issues, Stories of an Epic, Epic of a Story, subtasks of an issue, issues returned by a Groovy script or a JQL search, etc.)</span><span style="color: #091e42"> are in one of the specified statuses.</span>

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Block the transition of the Epic to Closed status, if its stories aren't closed.</span>

<details>
<summary>Steps</summary>

- Add the `Related issues status validator `to the **Close **transition.
- Select the issue link type `Epic of` `the current issue` from `Which Issue(s)` field.
- Select the statuses the linked issues must be in, from `Statuses`
- Add the error message, "`The Stories of the Epic are not yet resolved`"
</details>

### Related Issue(s) validator

This validator <span style="color: #091e42">ensures that a</span><span style="color: #172b4d"> link to one (or more) issue(s) from the current issue is being created during the transition, and/or that existing and/or newly related issues (such as linked issues, Stories of an Epic, Epic of a Story, subtasks of an issue, issues returned by a Groovy script or a JQL search, etc.) have certain characteristics.</span>

**Sample use cases:**

#### :light_bulb_on:<span style="color: #172b4d"> Block the creation of a Bug, if it is not linked to the corresponding functionality requirement.</span>

<details>
<summary>Steps</summary>

- Add the `Related issue validator `to the **Create **transition.
- Select the `Issues linked to the current issue through the following link type` from the `Issue Link Type` field.
- Select the issue link type `relates to` from the `Issue Link Type` field.
- Add the error message, "`Associate/Link the Bug to the respective requirement ticket`"
</details>