Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
I have a listener that I need to fire when the parent issue type is Bug and a date custom field on the parent is < Now(). Something like this:
issue.getParentObject().getIssueTypeObject().getName() == 'Bug' && issue.getParentObject().cfValues['GA Release Date']?.value < Now()
issue.getParentObject().getIssueTypeObject().getName() == 'Bug' works fine but issue.getParentObject().cfValues['GA Release Date']?.value < Now() does not. I am not sure how to get the value of the date custom field of the parent and how to compare that value with Now()
Any assistance is greatly appreciated.
Thank you
I assume the script is run on the Script Listeners and not in the Workflow condition?
If in the Script Listener, you can get the issue parent custom field value by using the following sample script:
def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Date")
def cfValue = issue.getParentObject().getCustomFieldValue(cf) as Date
log.warn "Custom Field value: "+cfValue
def now = new Date()
log.warn "Now: "+now
if(cfValue < now)
{
//dosomething
}
If doesn't help, please let us know where you run the script or send over some screenshots for us to have an overview.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.