Hi All,
As a project manager, I want stakeholders to be informed by sending email when the endDate which is custom field is behind schedule.
I've tried multiple examples of code that sends an email from a listener and they all fail at filter the above requirement.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def jiraBaseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)
def link="${jiraBaseUrl}/browse/${issue.key}"
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "endDate"}
if (change) {
log.debug "Old value(OriginalEndDate) : ${change.oldstring}"
log.debug "New value(UpdatedEndDate) : ${change.newstring}"
log.debug "Value changed by ${event.user} at ${event?.getChangeLog()?.created}"
// I want to send email above logs to stakeholders when New value(UpdatedEndDate) - Old value(OriginalEndDate) >= 1
}
When I've tried to create Send a custom email(non-issue events) for using CustomFieldUpdatedEvent, Every line seems to be needed as the validator complains.
How can I send email Associating proper script with the event listener?
Thank you in advance for your help.
Hello,
I think the subscribe filter feature can do this :
https://www.atlassian.com/blog/jira-software/jql-the-most-flexible-way-to-search-jira-3-of-4
If not let me know and I'll help you to find a way to achieve want you want to do !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.