Hi,
I'm looking for a custom script to send emails by parsing values in a csv file, when a state transition occurs.
We have a listener to listen status changed events.
I have written a custom script, but i'm struck to read values from csv and use it as email address. Please help me here.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
import com.atlassian.jira.user.ApplicationUser
def sendEmail(String emailAddr, String subject, String body) {
SMTPMailServer mailServer = ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer()
if (mailServer) {
Email email = new Email(emailAddr)
email.setSubject(subject)
email.setBody(body)
mailServer.send(email)
log.debug("Mail sent")
} else {
log.warn("..")
}
}
Thanks
Hi @manjupriya_t ,
Did you find the solution for this. If yes, please share me the solution.
Thanks,
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.