Hi all,
For one of the requirements that we have at the moment , custom listener from the script runner will be an option
The following listener that I used , is working fine .However email notifications are not sent for any updates.
Custom Listener on script runner.JPG
void issueUpdated(IssueEvent event)
{
try
{
Issue issue = event.getIssue()
if (issue.getIssueType()== "EPIC" )
{
List changeItems = event.getChangeLog().getRelated("changeItem")
if( changeItems.any {it.get('field')=='Fix Version/s'} )
{
def projectManager = issue.getProjectObject().getProjectLead().emailAddress
Email email = new Email( projectManager )
email.setSubject("Ticket ${issue.getParentObject()} Requires Review")
email.setBody("The Fix Version is updated recently for the issue $issue")
email.setMimeType("text/html")
SingleMailQueueItem item = new SingleMailQueueItem(email)
try {
ComponentAccessor.getMailQueue().addItem(item);
} catch (Exception e) {
log.warn("ERROR SENDING TICKET WATCHER EMAIL", e);
}
}
}
}