Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vikrantyadav11/6b80b429961e6a964f9e979c7e51f2a4 to your computer and use it in GitHub Desktop.
Save vikrantyadav11/6b80b429961e6a964f9e979c7e51f2a4 to your computer and use it in GitHub Desktop.
Hide/Unhide Field on Transition Screen Based on Dropdown field Value ( Jira Cloud)
const transitionId = await getContext().then(context => context.extension.issueTransition.id);
const releaseNotesField = getFieldById("customfield_10324");
releaseNotesField.setVisible(false)
// Get the custom field (10323) that controls the logic (Yes/No)
const changeField = getFieldById("customfield_10323");
const changeFieldValue = changeField.getValue().value
// Check condition: if transitioned to Done and changeField value is "Yes"
if (transitionId == 21 && changeFieldValue == "Yes") {
releaseNotesField.setRequired(true);
releaseNotesField.setVisible(true);
} else {
releaseNotesField.setRequired(false);
releaseNotesField.setVisible(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment