Forums

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

Using Groovy Script Runner how do I validate Checkboxes

Susan Hauth _Jira Queen_
Community Champion
January 14, 2013

Hi, This is a very simple question from a non-progarmmer. I have a Checkbox custom field (e.g. Reset Type) and I want to use the fast track based on one of the checkboxes being checked. So if custom field "Reset Type" had checkboxes with values: "Citrix", "Support", how would I write the validator to know that they have selected "Citrix"?

2 answers

1 accepted

5 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2013

This question has been asked quite a lot... the answer is:

cfValues['Reset Type']*.value.contains("Citrix")

Susan Hauth _Jira Queen_
Community Champion
January 14, 2013

Jamie, I seriously don't know what I would do without you!!! Thanks...it worked...

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2013

;-) ... no problem.

Georges Moubarak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2015

Dear @Jamie Echlin [Adaptavist] , Is there a way to do the same with Jython?

Akshay Bhagwat April 28, 2020

I am getting below issue, Please help me to resolve this.

groovy.lang.MissingPropertyException: No such property: cfValues for class: Script6 at Script6.run(Script6.groovy:1)

Karl Samson
Contributor
July 16, 2024

Perfect! Thank you. Just the code I needed!!

Karl Samson
Contributor
July 16, 2024

I tested both 'Yes' & 'No' selected in my scenario, and because it contains 'No' it transitioned. How could I also say....but does not contain 'Yes'? 

0 votes
RichardA April 22, 2020

Hi @JamieA 

The issue can be Auto-closed only when All the values of check box is enabled.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events