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

'Fields Required Validator (JMWE app)' Validator - field2 required if field1 has value X

Helena July 6, 2021

Can I add the following validator to transition into Close status:

If cascading list first value = Something, then custom field 'Field 2' is required

If cascading list first value = AnythingElse, then custom field 'Field 2' is not required

?

Was trying to use 'Fields Required Validator (JMWE app)' Validator,

selected the field: 'Field 2',

put the error message (optional),

selected 'Conditional validation', but can't get my condition working.

Also haven't found any similar example. Is it even possible to create sth like this?

Both fields are added on the screen.

 

1 answer

1 accepted

0 votes
Answer accepted
Suprija Sirikonda _Appfire_
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.
July 6, 2021

Hi @Helena ,

In the Field required validator, add the below code in the Conditional validation, which returns true if the parent value of the cascading field is equal to "Some value". 

issue.get("customfield_11601")?.get(null)?.value == "Some value"

customfield_11601 -> id of the cascading field. Modify the field id and the value as per your use case.

You can refer to "Issue Fields" tab in the Help section for snippets on how to access/test the value of fields.

JMWE conditional validation.png

Hope this helps!

Regards,

Suprija 

Helena July 7, 2021

Thank You Suprija! This worked.

I had altered the same condition wrongly (new to this syntax).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events