HI!
I have a use case to make a child level of a cascading field required.
I am trying to do this through a validator...
Cascading Field has two options:
How can I build a validator that will only trigger if Example 2 is picked without a child value selected?
Thanks!
using JMWE, you can create a Build-your-own (scripted) Validator, with code like this:
!!issue.customfield_12345 && !!issue.customfield_12345.child
where you'll replace customfield_12345 with the custom field ID of your cascading select field (which you can find on the "Issue Fields" help tab below the Jira expression editor).
One of the Cascading options doesn't have a child option. The code mentioned will cause it to fail when this option is selected.
If user selects Normal, the JMWE should pass.
However, if Hotfix is selected without selecting a child option, it should fail.
Cascading field:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, you cannot check possible values in a Jira Expression (this is a Jira limitation). Therefore, you'll need to hardcode the value that doesn't require a child option:
!!issue.customfield_12345 && (issue.customfield_12345.value == "Normal" || !!issue.customfield_12345.child)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.