How to use behaviours plugin to make a field mandatory based on comparison between two other fields.



We have a requirement to turn a field mandatory on the basis of result of comparison of two other fields. I am trying to use behaviours plugin for it but not able to succeed. I need some help to understand this plugin more. 

Also, I can not see Validate JIRA Requiredness in general settings as mentioned

in .

I have enabled the logging but how can I see the logs?




4 answers

add more info about what kind of comparison you needed.what are the fields you going to compare and what kind of field you going to make mandatory

Hi Nuwan,

So this is what I need:

We have a field called delivery date (date type) which is optional.

Other two fields are

Fixed Version (single choice list type) and Sprints (single choice list type).

Our requirement is that if the value chosen in fixed version is included in the list of Sprints then the delivery date should become mandatory.



try with this server side script
FormField sprint = getFieldByName("Sprint")
FormField fixedVersion= getFieldByName("Fixed Version")
FormField delivery = getFieldByName("Delivery Date")
String sprintValue = (String) sprint.getValue()
String fixedVersionValue = (String) fixedVersion.getValue()

Thanks, Nuwan. 

I thought you forgot me. smile

I will try this solution today and get back with results.





Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

352 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you