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

Hi,

 

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 https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin#JIRABehavioursPlugin-Description .

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

 

Regards

Sandeep

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.

Thanks 

Sandeep

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()
 if(sprintValue=fixedVersionValue)
  delivery.setRequired(true)
}

Thanks, Nuwan. 

I thought you forgot me. smile

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

 

Regards

Sandeep

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

346 views 0 1
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