Make a field required based on another field's value

I've reviewed the forums and have found solutions for this question using the Behaviors plugin and when the second field is a text field only - neither is what fulfills my need.  I cannot use the Behaviors plugin due to cost, but do have Script Runner installed.  

I need to make a multi-select list custom field, Current Products, if they select Yes from the single select custom field, Existing Client?.  

I thought ScriptRunner would be able to provide a solution, but, I've not been able to figure it out. I tried added a simple script validator. 

I had the following that when evaluated to true: 

  1. Script workflow function : Simple scripted validator : Checks script:
    cfValues['Existing Client']?.value == 'No'

It was associated with the field, Current Products and displayed the error message: 


You must select the products that the client has since you indicated that they were a current client. 

When I tried to use it, I just got an generic error message that there was a problem with the workflow (illegal operation), regardless of the value I selected. 

Would appreciate any solutions!

2 answers

0 votes

Um.  The Behaviours addon is free, like script runner, so I'm a bit confused by that statement.  Also, in later versions, Jamie has effectively merged them together, so if you're on JIRA 6.3 or above (and on the latest version of script runner for your version of JIRA), you have Behaviours as part of the Script runner.

That said, I think you're on the right track.  What error message are you getting though?  The "you must select the products..." looks right, but what is the first few lines of the "generic error message"/"illegal operation"?


Thanks, @a display name.  For some reason, I was thinking the behaviors plugin was a cost or separate; I had looked at using this type of functionality over a year ago as a nice-to-have; but, now, need it to be able to assist an organization to move onto our JIRA platform. 

When i select the transition, I'm getting the generic message: It seems that you have tried to perform an illegal operation. 


The attached is the validator that I created. 


I tried setting == Yes and ==No as I wasn't quite sure if it was to display when evaluated to True or False. But, either setting yielded the same result. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

877 views 3 9
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