---
title: "Uncheck/Unselect an option"
canonical: "https://support.appfire.com/space/JMWEC/465504594/Uncheck%2FUnselect%20an%20option"
format: markdown
---
> Macro (aura-html)

### Abstract

This code snippet unchecks a <span style="color: #333333">specific value of a standard or custom multi-valued type field (typically a </span>[multi-select field](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465505179)<span style="color: #333333">). The multi-valued fields can either be a collection of objects or a set of values. While unchecking all is easy (set the field with a blank value), unchecking only a particular option/value requires code. </span>

### Logic

Iterate over the array of currently selected options and add them into a new array ignoring the option that needs to be unchecked.

### Snippet 

#### For multi-select fields:

```javascript
{# Dump options that do not match the search  - Requires the "Treat as JSON" option #}
{{ issue.fields['<Name of the field>'] | filter({value:"<Value of the option to uncheck>"} , true ) | dump }}
```

##### Placeholders

| Placeholder | Description | Example |
| --- | --- | --- |
| `<Name of the field`> | Name of the field of type Checkboxes/Select list(multiple choices) | `Tasks list` |
| `<Value of the option to uncheck>` | Value of the option. | `Verification done` |

#### **For **multi-versions/users/components/groups fields (e.g. Fix Version/s):

```javascript
{# Dump values that do not match the search  - Requires the "Treat as JSON" option #}
{{ issue.fields['<Name of the multi-valued field>'] | filter({name:"<Value to uncheck>"} , true ) | dump }}
```

##### Placeholders

| Placeholder | Description | Example |
| --- | --- | --- |
| `<Name of the field`> | Name of the multi-valued field | `versions` |
| `<Value to uncheck>` | Value of the field. | `5.0.0` |

#### **For **Labels field:

```javascript
{# Dump labels that do not match the search  - Requires the "Treat as JSON" option #}
{{ issue.fields['<Labels field>'] | filter("<Label to remove>" , true ) | dump }}
```

##### Placeholders

| Placeholder | Description | Example |
| --- | --- | --- |
| `<Labels field`> | Name of the Label field | `Labels` |
| `<Label to remove>` | Label to be removed | `Merged` |

### Examples

The output of this code snippet is an array of objects which you could use to <span style="color: #333333">remove a particular option from the selected options of a field in one of the Set Field Value post-functions.</span>

> ⚠️ These code snippets require "Treat as JSON" option to be selected

- <span style="color: #000000">Remove the reporter from the JIRA service desk customers</span>
  
- <span style="color: #333333">Clear the option "To Print" after the print has been generated</span>
  
- <span style="color: #333333">Remove the label "Merged" when QA re-opens a ticket that has been merged into master and handed over to QA.</span>
  

### References

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [Accessing fields of an issue](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373107)
- [Treat value as JSON](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466256753)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |