Created
November 3, 2025 07:04
-
-
Save vikrantyadav11/4990bd16627696961670325c2a4db5ae to your computer and use it in GitHub Desktop.
Show Hide Dropdown Field Based on Another Dropdown in Jira scriptrunner for Jira Cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get the field objects | |
| const usesAI = getFieldById("customfield_28493"); | |
| const ai_feature_type = getFieldById("customfield_28494"); | |
| // Default state: hidden and not required | |
| ai_feature_type.setRequired(false); | |
| ai_feature_type.setVisible(false); | |
| // Get the value of the "Uses AI" field | |
| const usesAIValue = usesAI.getValue(); | |
| // ✅ Correct conditional check | |
| if (usesAIValue && usesAIValue.value === "Yes") { | |
| ai_feature_type.setRequired(true); | |
| ai_feature_type.setVisible(true); | |
| } else { | |
| ai_feature_type.setRequired(false); | |
| ai_feature_type.setVisible(false); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment