The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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!

DEPLOYMENT TYPE
SERVER
VERSION
8.20.11
TAGS
AUG Leaders

Atlassian Community Events