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

Sandeep Anand June 30, 2015

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

0 votes
Sandeep Anand July 1, 2015

Thanks, Nuwan. 

I thought you forgot me. smile

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

 

Regards

Sandeep

 

0 votes
Nuwan July 1, 2015
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)
}
0 votes
Sandeep Anand June 30, 2015

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

0 votes
Nuwan June 30, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events