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
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

457 views 8 27
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