Post-function Send an email allows to send an email with custom Subject and Body, setting recipients by means for fields, custom fields, groups, project roles or simply fixed email addresses.
You can send with your emails all or some of the attachments in the issue.
The post function also supports the field "Bcc"
In this example we define an email with a custom text that will be sent to issue reporter, users in field Request Participants, and to users in Service Desk Team project role. Users selected repeatedly are filtered, i.e., only one email is sent per recipient.
Project leader will receive a copy of the message, but in case he is also selected as direct recipient of the email (i.e., in To), then he will be automatically excluded from Cc.
If a file called resolution_report.pdf is attached to the issue, then it will be sent attached to the email.
We use parameter "Conditional execution", so that the email will only be sent if current issue's Security Level is different from "Classified". Note that %{00103} is field code for Security level virtual field.
Text to be pased is:
<p>Dear %{00067},</p>
<p>We send this email to inform you that issue <a href='%{00169}/browse/%{00015}' target='_blank'>%{00015}</a> has been closed at <em>%{00028}</em> on <em>%{00057}</em> by <em>%{00020}</em>.</p>
<p>Attached to this email you will find the <em>Resolution Report</em>.</p>
<p>Best regards,<br>
Your Service Desk</p>
Once configured, the transition will look like this:
Specifies the sender of the message. Four options are available for selecting the sender:
Specifies the direct recipients of the message. Five options are available:
Even though an email address may appear more than once in the selection, only one email will be sent per email address.
Specifies secondary recipients of email that receive a copy of the email. Same five options as in parameter To are available for selecting this kind of recipients.
If an email address has been previously selected as direct recipient (i.e., in To), it will be excluded in runtime from Cc, i.e., a same email address will not receive the same message as To and Cc at the same time.
Specifies recipients that won't get seen by recipients from "To" and "Cc". Same five options as in parameter To are available for selecting this kind of recipients.
If an email address has been previously selected as direct recipient (i.e., in To), it will be excluded in runtime from Bcc, i.e., a same email address will not receive the same message as To and Bcc at the same time.
To options are available:
The title of the email message. You can inject field codes that will be replaced with their corresponding field values at runtime.
The main text of the email message. You can inject field codes that will be replaced with their corresponding field values at runtime.
Two formats are available:
Field codes are supported by both formats of email's body.
Files attached to the issue can be sent as email attachments. There are three options available:
We can filter the files to be attached using the following parameters:
Parameters "Attach files by extension" and "Attach files by name" work as a union set operation, i.e., issue attachments matching any of the two parameters, will be attached to the email. If you leave both parameters empty, all the attachments will be attached to the email, i.e., no filtering is applied.
Optional actions that will be executed along with sending emails. Available actions are:
Only those recipients who are Jira users will be effectively added as watchers.
When using Personalized sending mode, fields Ephemeral string 4 and Ephemeral string 5 will contain the email's Subject and Body of a random email of the several ones possibly sent.
If you want to send the email depending on a condition, you can enter a boolean expression in this parameter, and only when the boolean expression is satisfied the email is sent, otherwise nothing happens. You can make your boolean expression depend on the values of one or more fields, issue links, sub-tasks, etc. Use the syntax defined by the Expression Parser.