With Adaptavist Scriptrunner or MyGroovy plugins for Jira Server and a little groovy script we can validate/require or make mandatory the second drop down of a cascading field.

Just create a Simple scripted validator in the transition! Example:


cfValues["The name of your customfield"]?.keySet()?.size() == 2

Very easy!

Example:

captura de pantalla 2019-01-29 a las 17.37.32

By MrAddon

Advertisements
Posted by:.

2 replies on “Solution for making second drop down required in cascading custom field

  1. MyGroovy:
    Maybe I complicate it, but I not found easier solution than this:
    import com.opensymphony.workflow.InvalidInputException
    import com.atlassian.jira.component.ComponentAccessor
    if (issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(“customfield_XXXX”))?.keySet()?.size() == 2) {
    return true
    } else {
    throw new InvalidInputException(“error message”)
    }

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s