Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Behaviours in cloud

Eduard Diez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2024

 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 have a custom field called "RolloutTypeField" (customfield_10824).
  • When "RolloutTypeField" has a specific value (in this case, '13217'), I want another field, let's call it "Field10762", to become mandatory. Otherwise, it should remain optional.
  • Additionally, if possible, I'd like an alert or some form of notification to inform users that "Field10762" is mandatory when the specific value is selected in "RolloutTypeField".

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:

 

javascript
Copy code
// 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,

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events