Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

MULTI SELECT CUSTOM FIELD WORKFLOW VALIDATION

Mateusz Janus November 30, 2025

Hello Brothers and Sisters

I have custom field "RMC Approvals CHeck", multiselect checkbox
multiselect checkbox.jpg

I need a WOrkflowValidation. WHen Status changes to ABC I need to check if ALL options from custom field are selected

workflow validator.jpg

I build Validator with script like below

validator.jpg

But it does not work. Thereis no any error on logs or anything. I can still change the status even if not all checks are selected. Can u advice where i have a bug here?

2 answers

0 votes
Kseniia Trushnikova
Community Champion
November 30, 2025

Hi @Mateusz Janus,

This should work:

Screenshot 2025-11-30 at 20.47.49.png

def selectedValues = issue.get("customfield_11770")
def requiredValues = issue.getAvailableOptions("customfield_11770")

selectedValues == requiredValues

Basically, it checks if the list of selected checkboxes matches the list of all available checkboxes.

I'd recommend to use Build-your-own Validator, that is another validator from JMWE.

Field Required Validator checks whether the field is empty, but it is not considered empty even if only one checkbox is checked. So, be careful with it.

0 votes
Mateusz Janus November 30, 2025

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.option.Option

def customFieldManager = ComponentAccessor.customFieldManager
def cf = customFieldManager.getCustomFieldObject("customfield_11770")

if (!cf) {
log.warn("Custom field not found")
return false
}

def fieldValue = issue.getCustomFieldValue(cf)
if (!fieldValue) {
return false
}

// Extract option values safely
def selectedValues = fieldValue.collect { it.value }

// Define required list
def requiredValues = [
"CAB Approval",
"Cybersecurity Approval",
"QA Signoff",
"UAT Approval",
"Release Announcement"
]

// Return TRUE only if all required options are present
def allSelected = requiredValues.every { it in selectedValues }

return allSelected

Suggest an answer

Log in or Sign up to answer