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)
//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')
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events