Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Conditional Validator using Scriptrunner Syntax

Andrea Hakim March 16, 2017

In a transition, I want to make a field LOB(Other) required if "Other" is selected for field Lines of Business.

Lines of Business is a multi-select

LOB(Other) is a text field.

if ('Other' in cfValues['Lines of Business']*.value) {
return cfValues['LOB(Other)'] != null
}

This code stops all transitions if LOB(Other) is null, regardless of what Line of Business I choose.

 

I've also tried this:

'Other' in cfValues['Lines of Business']*.value || ('Other' in cfValues['Lines of Business']*.value && cfValues['LOB(Other)'] != null)

 

Appreciate any help.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Thanos Batagiannis [Adaptavist]
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.
March 16, 2017

Hi Andrea,

Try something like (replace with your fields and values)

('AAA' in cfValues['MultiSelectA']*.value && cfValues['TextFieldA']) || !('AAA' in cfValues['MultiSelectA']*.value)

regards, Thanos

TAGS
AUG Leaders

Atlassian Community Events