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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.