In this page

Sending a Twilio SMS about a new changeset

Twilio is a communications platform geared mostly towards software developers. Twilio is used to programmatically make and receive phone calls, send and receive text messages, and perform other communication functions.

This automation sends a notification SMS message to a phone number about the changeset after that has been accepted by the repository:

The SMS content can be freely customized, allowing you to post anything from short summaries to longer details.

Configuration

  1. Login to your Twilio account and go to your Dashboard.
  2. Setup a phone number that Twilio can use to send SMS.
  3. You will find your Account SID and Auth token here. These will be needed later.
  4. Login to Jira as admin, go to AdministrationSystemAutomation rules.
  5. Click Create rule.
  6. Select the trigger Changeset accepted (from the DevOps category).
  7. Click Save.
  8. Click Add component and select New condition.
  9. 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.
  10. Click Save.
  11. Click New action.
  12. Select the action Send Twilio notification.
    1. Fill the Account SID, Auth token and From fields based on your Twilio account details.
    2. Enter the phone number Twilio generated for you in the From field. (You can find it in the Active Numbers list.)
    3. Enter a valid phone number or multiple numbers separated by commas in the To field.
    4. Compose the SMS message in the Message body field:
      [DEVOPS] {{devops.changeset.commits.size}} new commit{{#devops.changeset.commits}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}{{^devops.changeset.commits}}s{{/}}{{^issues.size}}.{{/}}{{#issues.size}} linked to the issue{{#issues}}{{^first}}{{#last}}s{{/}}{{/}}{{/}}{{^issues}}s{{/}}:
      {{#issues}}
      {{key}} - {{summary}}
      {{/}}
      {{/}}
      
      Notes:
      • You should keep the body relatively short, as longer bodies may be split to multiple SMS messages depending on the SMS character limit.
  13. Click Save.
  14. 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 SMS message will be sent to the selected phone number with the change summary and the linked issue list.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Questions?

Ask us any time.