Forums

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

Check Multiple Custom Fields for Condition in ScriptRunner

Brandon Webb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 8, 2024

I'm trying to create a transition using ScriptRunner that checks multiple Custom Fields, if any of the fields contains a value of "Yes", then the transition may continue and create the Sub-tasks.

The sample Condition below works as expected checking a single custom field for "Yes", however, I don't know the syntax to have it check multiple fields.

Working:

  • cfValues['CustomField1']*.value.contains("Yes")
Tried but not valid:
  • cfValues['CustomField1' OR 'CustomField2' OR 'CustomField3']*.value.contains("Yes")
  • cfValues['CustomField1']*.value.contains("Yes") OR cfValues['CustomField2']*.value.contains("Yes") OR cfValues['CustomField3']*.value.contains("Yes")

1 answer

1 accepted

1 vote
Answer accepted
Tuncay Senturk _Snapbytes_
Community Champion
January 8, 2024

Hi @Brandon Webb 

Did you try || operator instead of OR?

cfValues['CustomField1']?.value.contains("Yes") || 
cfValues['CustomField2']?.value.contains("Yes") ||
cfValues['CustomField3']?.value.contains("Yes")
Brandon Webb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 8, 2024

Using || instead of OR worked perfectly.  Thanks so much!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.11
TAGS
AUG Leaders

Atlassian Community Events