hi
I want to send custom attachment in mail that not attached on issue
I make it on jira file directory in address (/sharedhome/data/attachment-test/447788)
for example 447788 is atatchment id in this directory and file name is viop.pdf
my script for send email is below and work right in custom script:
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
import com.atlassian.jira.component.ComponentAccessor
def subject = "Insert text here for ${issue.key}"
def body = "Hi ${issue.assignee.displayName} \n\nNow that XXXXX has been released, please complete XXXXX for the following issue: https://XXXXXXX/${issue.key} - ${issue.summary}. \n\n"
def emailAddr = issue.getAssignee().getEmailAddress()
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)
} else {
// log this error
}
}
sendEmail (emailAddr, subject, body)
please help me to add attachment in this script
thanks regard