Behaviours marks field readonly while date menu is open

We have a behaviour script

import java.text.SimpleDateFormat
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.datetime.DateTimeFormatterFactory
import com.atlassian.jira.datetime.DateTimeStyle
def oDate = getFieldById("customfield_16324").getValue()  as Date
def eDate = getFieldById("customfield_16325").getValue()
def dateTimeFormatterFactory = ComponentAccessor.getComponentOfType(DateTimeFormatterFactory)
def formatter = dateTimeFormatterFactory.formatter().forLoggedInUser().withStyle(DateTimeStyle.DATE_PICKER)
def formatteddate = formatter.format(oDate)
if ( ! eDate ) {
if ( oDate != null) {
} else {

And when we are entering the date field and switching months the field populates while we switch months thus locking the field and setting the value of the next field we copy it to.  Is there a way to ensure that the script does not execute until a value is entered in the field and the menu is not open to change months.

2 answers

This widget could not be displayed.

Hi Kevin, 

I see what you mean. I am afraid that there is not an easy solution in that case. I suppose the best solution was to check the oDate for a specific month or date, instead of just checking for a value.


This widget could not be displayed.

Thank you.  We were afraid of that.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

126 views 1 3
Join discussion

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