I have xls report file on the server and need to send this file in email in scriptrunner but don't understand how to add file in email
def mailServer = ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer()
if (mailServer) {
Email email = new Email(to)
email.setCc(cc)
email.setSubject(subject)
email.setBody(body)
email.setMimeType("text/html")
mailServer.send(email)
log.debug("Mail sent to (${to}) and cc'd (${cc})")
}
I can add only String body.
I think the attachment goes to its separate "part". So check out the Email class' methods for how to work with "email parts".
I've checked out com.atlassian.email and haven't found anything about attachments
i searched here https://docs.atlassian.com/software/jira/docs/api/7.13.8/com/atlassian/jira/mail/Email.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.