Hello
I am completely new to JIRA administration, we are using script runner to schedule different jobs, and one of the requirement is, based on the certain filter condition results, a job needs to be scheduled on certain time frame to send email with the customized body, JIRA ticket number etc,.
What i have tested so far is just simple email sending code which is as follows..
import com.atlassian.mail.Email
import com.atlassian.mail.server.SMTPMailServer
import com.atlassian.jira.component.ComponentAccessor
def emailSubject = "JIRA CHECK"
def emailBody = "Test CHECK"
def emailAddress = "<emaild id>"
SMTPMailServer mailServer = ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer()
if (mailServer) {
Email email = new Email(emailAddress)
email.setSubject(emailSubject)
email.setBody(emailBody)
mailServer.send(email)
} else {}