This snippet shows you how to send a custom email. You can use the method inside in any script designed to send an email.
I want to send an email when an issue transitions from In progress to Done to update the customer on their issue status. I can use this snippet inside a post-function script.
-
An outgoing mail server needs to be enabled.
-
An SMTP mail server needs to be configured
This escalation service is used to trigger an email that notifies approvers of pending issues, once their email has been retrieved using the REST Endpoint.
In this example, a reminder email is triggered, after the email addresses of an issue’s outstanding approvers were obtained via a REST Endpoint.
- For Jira versions prior to 8.10.0, the additional Thread parameters are not required to send the email as shown in the example below:
def email = new Email(emailAddress)
email.setSubject(subject)
email.setBody(body)
email.setMimeType('text/html')
mailServer.send(email)
Send an email to all watchers of an issue with the change history items in the last X days. Edit the number of days to go back by changing the lastDays
variable. Modify the script to set the jiraIssue
variable depending on where you add the script (for example, in a post function use issue.key
instead of TEST-1
).
As a project manager, I want to keep track of all changes to my watched issues. I need to be up to date with who is working on an issue and what has been changed. I do not want to check each watched issue manually. I can use this script to send me an email with change history items weekly to keep informed.
Original: https://www.cnblogs.com/freeliver54/p/15885396.html
Author: freeliver54
Title: [转]Jira ScriptRunner Send Custom Email
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/545377/
转载文章受原作者版权保护。转载请注明原作者出处!