Hi Atlassian Community,
I'm reaching out for assistance with Cloud Behaviours. Specifically, I'm trying to implement a behavior where one field becomes mandatory based on the value of another field.
Here's the scenario:
I've attempted to achieve this using a script, but I haven't had success so far. Below is the script I've been using:
// Get the RolloutType field (customfield_10824)
var rolloutTypeField = getFieldById('customfield_10824');
// Check if the RolloutType field has the value "13217" selected
if (rolloutTypeField.getValue().some(option => option.value === '13217')) {
// If the value "13217" is selected, make the Field10762 field mandatory
getFieldById('customfield_10762').setRequired(true);
// Show an alert message
alert('Attention! The field "Field10762" is mandatory.');
} else {
// If the value "13217" is not selected, make the Field10762 field optional
getFieldById('customfield_10762').setRequired(false);
}
I would greatly appreciate any guidance or suggestions on how to properly implement this behavior in Jira Cloud.
Thank you in advance for your help!
Best regards,
Community moderators have prevented the ability to post new answers.