Skip to end of metadata
Go to start of metadata
On this page


Purpose

Post-function Send an email allows to send an email with custom Subject and Body, setting recipients by means for fieldscustom fieldsgroupsproject roles or simply fixed email addresses.

You can send with your emails all or some of the attachments in the issue. 



Example: Notifying issue closing to request participants and Service Desk team

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.





Once configured, the transition will look like this:




Configuration Parameters

From

Specifies the sender of the message. Four options are available for selecting the sender:

  • Default: the default sender used by Jira when doing notifications by email.
  • Project Email Address: it's possible to configure a project's email address, which is the email address that notifications are sent from.
  • User in Field: user selected in a User Picker field, or user whose user name is in a text field.
  • Email Address in Field: email address appearing in a text field. In case the field contains more than one email address, the first one found will be selected.
  • Email address: a literal email address entered.

To

Specifies the direct recipients of the message. Five options are available:

  • Users in Field: users selected in User Picker or Multi-User Picker fields, or users whose user name is contained in text fields. Comma, semicolon, or space characters can be user to separate the user names. Don't confuse user name with user's full name.
  • Emails in Field: email addresses contained in text fields. All the email addresses found will be used as email's recipients. The email addresses may appear among fragments other text fragments, e.g., if you select field Description, any email address appearing in the description of the issue will be used as recipient of the email.
  • Project Roles: all the users in selected project roles will receive the email.
  • Groups: all the users in selected groups will receive the email.
  • Comma separated list of email addresses: all the email addresses input will receive the email.

Even though an email address may appear more than once in the selection, only one email will be sent per email address.

Cc

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.

Sending mode

To options are available:

  • Common: only one email will be sent to all the selected recipients in To and Cc paramenters. All the users in To will be visible to all the recipients of the email.
  • Personalized: each email address in To will receive a unique message, i.e., only a recipient will appear in field To in the email. In this mode Ephemeral string 4 contains the recipient's user name, and Ephemeral string 5 contains the recipient's full user name. This way you will be able to mention each individual recipient in the Subject and the Body of your custom messages. These two fields will not be filled up for recipients selected using Emails in Field, and Comma separated list of email addresses options, since no JIRA user is associated in those cases.

Email's subject

The title of the email message. You can inject field codes that will be replaced with their corresponding field values at runtime.

Email's body

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:

  • Plain text
  • HTML: you can use html tags to set the format and layout of the message.

Field codes are supported by both formats of email's body.

Attachments

Files attached to the issue can be sent as email attachments. There are three options available:

  • No Attachments: no files are attached to the email.
  • All files attached to the issue: all the issue attachments will be attached to the email, except those filtered by next parameters.
  • Only files attached in current transition: files attached to the issue using the screen associated to current transition will be also attached to the message, except those filtered by next parameters.

We can filter the files to be attached using the following parameters:

  • Size limit per file in KB: files exceeding the size limit will not be attached to the message. Leave this parameter empty if you don't want to set size limit.
  • Attach files by extension: enter a list of extensions separated by spaces. Issue attachments with selected extensions will also be attached to the email.
  • Attach files by name: enter a regular expression, so that issue attachments whose names match the entered regular expression will be attached to the email. If you are not familiarized with regular expression, you can simply use a list of file names separated by | character.

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.

Additional actions

Optional actions that will be executed along with sending emails. Available actions are:

  • Add To recipients as watchers of current issue.
  • Add Cc recipients as watchers of current issue.

Only those recipients who are Jira users will be effectively added as watchers.

  • Save email information into Ephemeral String fields (ES1...ES5), to be used in subsequent post-functions:
    • Ephemeral string 1: Contains the sender's full name (only in the case of Jira users) and its email address, i.e. the From field.
    • Ephemeral string 2: Contains the user's full names (only in the case of Jira users) and the email addresses of the To recipients.
    • Ephemeral string 3: Contains the user's full names (only in the case of Jira users) and the email addresses of the Cc recipients.
    • Ephemeral string 4: Contains the Subject of the email.
    • Ephemeral string 5: Contains the Body of the email in text format. If the email is composed in HTML, it's transformed into text removing tags, and inserting line returns where it's convenient in order to keep a readable aspect.

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.

Conditional execution

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.



Usage Example


Related Features