Simple Scripted Validator: Require Due Date Reason if Due Date Selected

Todd Ford July 27, 2017

I've been mucking around with a Simple Scripted Validator (using ScriptRunner) for a while now. I clearly don't know what I'm doing. This is what I'm trying to do:

I have a Due Date Reason custom multi-line text field. I'd like it to be required only if the Due Date field has a selected value.

I'm using JIRA 7.3.1 and Adaptavist ScriptRunner 5.0.4.

1 answer

1 accepted

0 votes
Answer accepted
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2017

Try the following code (check the exact name of custom field)

if(issue.getDueDue()) {

  if(!cfValues['Due Date Reason'] ) {

    return false;

    }

}

return true;

Todd Ford July 28, 2017

This worked great! Thanks Tarun. I did have to fix one typo. I changed the first line to getDueDate.

Suggest an answer

Log in or Sign up to answer