In this page

Overview

Email is still the most widely used notification medium.

Watch this short tutorial video about creating and using email automations, then follow the step-by-step guides in the next sections:

Sending a notification email about a new changeset

This automation sends a notification email about the changeset after that has been accepted by the repository:

The email recipients, subject, content and other details can be freely customized. Note that you can also use this approach to integrate external services that accept email as "incoming message" format to your DevOps pipelines.

Configuration

  1. Login to Jira as admin, go to AdministrationSystemAutomation rules.
  2. Click Create rule.
  3. Select the trigger Changeset accepted (from the DevOps category).
  4. Click Save.
  5. Click Add component and select New condition.
  6. Select the condition Advanced compare condition.
    1. Enter {{devops.changeset.commits.size}} to the First value field.
    2. Choose the does not equal option from the Condition dropdown.
    3. Enter "0" to the Second value field.
  7. Click Save.
  8. Click New action.
  9. Select the action Send email.
    1. Choose a recipient group or enter the addresses manually.
    2. Enter the following subject:
      [DEVOPS] {{devops.changeset.commits.size}} new commit{{#devops.changeset.commits}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}{{^devops.changeset.commits}}s{{/}} in {{devops.changeset.repositoryId.htmlEncode}}
    3. Enter the following content (a very simple template you can easily customize to your needs):
      <p>
      	{{#issues.size}}
      		<b>{{issues.size}} issue{{#issues}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}</b> linked:
      	{{/}}
      	{{^issues.size}}
      		No issues linked.
      	{{/}}
      </p>
      <ul>
      	{{#issues}}
      		<li><a href="{{url}}">{{key}}</a> {{summary.htmlEncode}}</li>
      	{{/}}
      </ul>
      {{#devops.changeset.commits}}
      	<p>&mdash;&mdash;&mdash;&mdash;&mdash;</p>
      	<p>Commit: <b>#{{id}}</b> &middot; Branch: <b>{{branch.htmlEncode}}</b> &middot; Author: <b>{{author.htmlEncode}}</b></p>
      	<blockquote style="background:#f4f5f7; padding:0.25em 0.5em; border-left:5px solid #c1c7d0;">{{message.htmlEncode.replace("&#10;","<br>")}}</blockquote>
      	<p><b>{{files.size}} file{{#files}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}{{^files}}s{{/}}</b> changed:</p>
      	<ul>
      		{{#files}}
      			<li><b><code style="color:{{action.color}}">{{action.label}}</code></b> {{path.htmlEncode}}</li>
      		{{/}}
      	</ul>
      {{/}}
      
      Notes:
      • Those smart values that can contain HTML-unsafe characters should be HTML-encoded with .htmlEncode.
      • Those smart values that can contain multi-line strings should be transformed with .replace("&#10;","<br>").
    4. Click More options.
    5. Choose HTML as format.
    6. Uncheck the Convert line breaks to HTML line breaks checkbox.
  10. Click Save.
  11. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a commit in your repository with this message:
    Implement the FOO-1 feature.
  2. Then another with this:
    Fix the FOO-2 and FOO-3 bugs.
  3. An email will be sent to the selected recipients with the linked issue list and the commit details.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Sending a notification email about a rejected changeset

This automation sends a notification email after a changeset has been rejected by the commit policy (which is applied to the repository).

Configuration

  1. Login to Jira as admin, go to AdministrationSystemAutomation rules.
  2. Click Create rule.
  3. Select the trigger Changeset rejected (from the DevOps category).
  4. Click Save.
  5. Click New action.
  6. Select the action Send email.
    1. Choose a recipient group or enter the addresses manually.
    2. Enter the following subject:
      [DEVOPS] Changeset rejected in {{devops.changeset.repositoryId.htmlEncode}}
    3. Enter the following content (a very simple template you can easily customize to your needs):
      <blockquote style="background:#ffebe6; padding:0.25em 0.5em; border-left:5px solid #de350b;">{{devops.rejectionMessage.htmlEncode.replace("&#10;","<br>")}}</blockquote>
      <p>&mdash;&mdash;&mdash;&mdash;&mdash;</p>
      <p>
      	{{#issues.size}}
      		<b>{{issues.size}} issue{{#issues}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}</b> linked:
      	{{/}}
      	{{^issues.size}}
      		No issues linked.
      	{{/}}
      </p>
      <ul>
      	{{#issues}}
      		<li><a href="{{url}}">{{key}}</a> {{summary.htmlEncode}}</li>
      	{{/}}
      </ul>
      {{#devops.changeset.commits}}
      	<p>&mdash;&mdash;&mdash;&mdash;&mdash;</p>
      	<p>Commit: <b>#{{id}}</b> &middot; Branch: <b>{{branch.htmlEncode}}</b> &middot; Author: <b>{{author.htmlEncode}}</b></p>
      	<blockquote style="background:#f4f5f7; padding:0.25em 0.5em; border-left:5px solid #c1c7d0;">{{message.htmlEncode.replace("&#10;","<br>")}}</blockquote>
      	<p><b>{{files.size}} file{{#files}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}{{^files}}s{{/}}</b> changed:</p>
      	<ul>
      		{{#files}}
      			<li><b><code style="color:{{action.color}}">{{action.label}}</code></b> {{path.htmlEncode}}</li>
      		{{/}}
      	</ul>
      {{/}}
      
      Notes:
      • Those smart values that can contain HTML-unsafe characters should be HTML-encoded with .htmlEncode.
      • Those smart values that can contain multi-line strings should be transformed with .replace("&#10;","<br>").
    4. Click More options.
    5. Choose HTML as format.
    6. Uncheck the Convert line breaks to HTML line breaks checkbox.
  7. Click Save.
  8. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a commit in your repository which results in rejection.
  2. An email will be sent to the selected recipients with the repository ID and the rejection message.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Sending a notification email about a new branch

This automation sends a notification email about a branch after that has been created in the repository.

Configuration

  1. Login to Jira as admin, go to AdministrationSystemAutomation rules.
  2. Click Create rule.
  3. Select the trigger Branch created (from the DevOps category).
  4. Click Save.
  5. Click New action.
  6. Select the action Send email.
    1. Choose a recipient group or enter the addresses manually.
    2. Enter the following subject:
      [DEVOPS] New branch "{{devops.branch.htmlEncode}}" in {{devops.changeset.repositoryId.htmlEncode}}
    3. Enter the following content (a very simple template you can easily customize to your needs):
      <p>
      	New branch created in repository <b>{{devops.changeset.repositoryId.htmlEncode}}</b>: "{{devops.branch.htmlEncode}}"
      </p>
      <p>
      	{{#issues.size}}
      		<b>{{issues.size}} issue{{#issues}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}</b> linked:
      	{{/}}
      	{{^issues.size}}
      		No issues linked.
      	{{/}}
      </p>
      <ul>
      	{{#issues}}
      		<li><a href="{{url}}">{{key}}</a> {{summary.htmlEncode}}</li>
      	{{/}}
      </ul>
      
      Notes:
      • Those smart values that can contain HTML-unsafe characters should be HTML-encoded with .htmlEncode.
      • Those smart values that can contain multi-line strings should be transformed with .replace("&#10;","<br>").
    4. Click More options.
    5. Choose HTML as format.
    6. Uncheck the Convert line breaks to HTML line breaks checkbox.
  7. Click Save.
  8. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a branch and push that to your repository.
  2. An email will be sent to the selected recipients with the repository name and the branch name.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Sending a notification email about a new tag

This automation sends a notification email about a tag after that has been created in the repository.

Configuration

  1. Login to Jira as admin, go to AdministrationSystemAutomation rules.
  2. Click Create rule.
  3. Select the trigger Tag created (from the DevOps category).
  4. Click Save.
  5. Click New action.
  6. Select the action Send email.
    1. Choose a recipient group or enter the addresses manually.
    2. Enter the following subject:
      [DEVOPS] New tag "{{devops.tag.htmlEncode}}" in {{devops.changeset.repositoryId.htmlEncode}}
    3. Enter the following content (a very simple template you can easily customize to your needs):
      <p>
      	New tag created in repository <b>{{devops.changeset.repositoryId.htmlEncode}}</b>: "{{devops.tag.htmlEncode}}"
      </p>
      <p>
      	{{#issues.size}}
      		<b>{{issues.size}} issue{{#issues}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}</b> linked:
      	{{/}}
      	{{^issues.size}}
      		No issues linked.
      	{{/}}
      </p>
      <ul>
      	{{#issues}}
      		<li><a href="{{url}}">{{key}}</a> {{summary.htmlEncode}}</li>
      	{{/}}
      </ul>
      
      Notes:
      • Those smart values that can contain HTML-unsafe characters should be HTML-encoded with .htmlEncode.
      • Those smart values that can contain multi-line strings should be transformed with .replace("&#10;","<br>").
    4. Click More options.
    5. Choose HTML as format.
    6. Uncheck the Convert line breaks to HTML line breaks checkbox.
  7. Click Save.
  8. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a tag and push that to your repository.
  2. An email will be sent to the selected recipients with the repository name and the tag name.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Questions?

Ask us any time.