Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Can any one provide Groovy Script
Need a validator Script for.
1. All the check boxes in the field are selected ( or ) Current user is in developer role in project.
Both the conditions need to be in the script.
Tried few scripts but the selection of all the checkboxes wont work.
A checkbox returns a list of selected options.
You'll need to compare that list of selected (checked) options against the list of available options for that field in the current context.
This should work in a simple scripted validator (in your workflow)
import com.atlassian.jira.component.ComponentAccessor
//for this you'll need a customfield object for the checkbox field
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName('my checkbox field')
//So that you can get the configuration context
def config = cf.getRelevantConfig(issue)
// and the list of associated options
def cfOptions = ComponentAccessor.optionsManager.getOptions(config)
//then, for good measures, get the list of values in a sorted order so you can compare them. Sorting may not be necessary, I suspect the order will alway be the same, but it can't hurt
cfOptions*.value.sort() == cfValues['my checkbox field']*.value.sort() || isUserMemberOfRole('Developers')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.