I created a script that tracks the status of epic/sub-task and closes the parent link/initiative based on their statuses. I wanted to email the log/output of the script either as an attachment or body, how do I go about doing this?
Here is some sample code for sending an email via the default jira mail system
MailServerManager mailServerManager = ComponentAccessor.mailServerManager
SMTPMailServer mailServer = mailServerManager.defaultSMTPMailServer
if (!mailServer) return "No mailServer found on this instance"
if (!MailFactory.settings.sendingDisabled) return "Can't send emails while Outgoing mail is disabled"
Email email = new Email('email@example.com,firstname.lastname@example.org')
email.subject = "your custom subject"
email.body = "your body, dump your logs in here"
email.mimeType = "text/plain" //or "text/html"
SingleMailQueueItem item = new SingleMailQueueItem(email)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event