The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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 Champions.
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events