In this page

How to generate PDF documents from Jira and send them in email?

Automatically generating PDF files and sending them as email attachments to one or more recipients is an efficient way to keep your stakeholders informed about Jira work items.

You can implement this process by configuring a simple automation flow:

Every time the flow is executed, recipients will receive an email with the PDF file attached:

To have this in minutes, just follow the step-by-step guides in the next sections!

Notes:

  • Although the guides are written specifically for the Scheduled and the Work item Event (created, updated, etc.) triggers, you can choose any other trigger!
  • Although the guides are written to implement the "bare minimum" flows, you can freely add further actions or conditions for altered logic!
  • The email with the PDF file attachment is sent from the "no-reply@jpdfc.midori.systems" address. This is a verified email address and cannot be changed due to security reasons.

Send PDF documents in email from a JQL query on a specified schedule

Watch this short tutorial video, then follow the detailed steps under the video:

Configuration steps:

  1. Login to Jira as administrator.
  2. Go to Settings (cog icon "⚙" in the top right) → System (under Jira settings) → Global automation (in the left-bar under Automation).
  3. Click Create flow → Create from scratch.
  4. Select the Scheduled trigger and configure the schedule. (Do not check Run a JQL search... as the JQL query will be configured via the next action.)
  5. Click Next → Action.
  6. Select the Export PDF action and:
    1. Click Connect.
    2. At the Export section, generate the YAML fragment in a new browser tab and import that.
    3. At the Actions section, click the Send button and set the recipients, email subject and body.
    4. At the Webhook section, set the callback flow's URL and secret (help).
      For Jira Cloud Premium and Enterprise plans (where a separate callback flow is not required, therefore was not created), use these dummy values for now:
      • URL: https://api-private.atlassian.com/automation/webhooks/jira/a
      • Secret: 123
      See further instructions after completing the current steps.
  7. Click Next → Action.
  8. Select the Log action (not Log work!) and copy this to Log message:
    PDF automation started. (ID: {{createdJiraExport.messageId}}, Log command: "{{createdJiraExport.logCommand}}")
    
  9. Click the "…" icon in the top right corner and select Flow details.
  10. Enter "Send PDF on a specified schedule" to Flow name. (You can use any name as long as it is intuitive.)
  11. Set Notify on error to E-mail flow owner every time this flow fails.
  12. Click Save and enable at the top.
  13. Click Return to flows ("←" icon in the top left corner of the editor).
  14. You're done!

For Jira Cloud Premium and Enterprise plans (where a separate callback flow is not required, therefore was not created), follow these additional steps:

  1. Edit the flow.
  2. On the left, below the Export PDF action, click Add step ("+" icon) → Controls → Delay until.
  3. At the Event field, select Webhook received.
  4. At the Time out period field, set 10 minutes.
  5. At the top, click Save.
  6. Click the Generate webhook section to open it.
  7. Click the regenerate icon ("⟲" on the right side of the Secret field), then the Regenerate button.
  8. Copy the value of the Secret field and paste that to the Secret field of the Export PDF action. (Also save it somewhere safe as it will be unreadable once you leave this step.)
  9. Copy the value of the URL field and paste that to the URL field of the Export PDF action.
  10. At the top, click Save again.
  11. You're done!

Send PDF documents in email on work item events (created, updated, commented, etc.)

Watch this short tutorial video, then follow the detailed steps under the video:

Configuration steps:

  1. Login to Jira as administrator.
  2. Go to Settings (cog icon "⚙" in the top right) → System (under Jira settings) → Global automation (in the left-bar under Automation).
  3. Click Create flow → Create from scratch.
  4. Select any of the Work item triggers.
  5. Click Next → Action.
  6. Select the Export PDF action and:
    1. Click Connect.
    2. At the Export section, generate the YAML fragment in a new browser tab and import that.
    3. At the Actions section, click the Send button and set the recipients, email subject and body.
    4. At the Webhook section, set the callback flow's URL and secret (help).
      For Jira Cloud Premium and Enterprise plans (where a separate callback flow is not required, therefore was not created), use these dummy values for now:
      • URL: https://api-private.atlassian.com/automation/webhooks/jira/a
      • Secret: 123
      See further instructions after completing the current steps.
  7. Click Next → Action.
  8. Select the Log action (not Log work!) and copy this to Log message:
    PDF automation started. (ID: {{createdJiraExport.messageId}}, Log command: "{{createdJiraExport.logCommand}}")
    
  9. Click the "…" icon in the top right corner and select Flow details.
  10. Enter "Send PDF on work item event" to Flow name. (You can use any name as long as it is intuitive.)
  11. Set Notify on error to E-mail flow owner every time this flow fails.
  12. Click Save and enable at the top.
  13. Click Return to flows ("←" icon in the top left corner of the editor).
  14. You're done!

For Jira Cloud Premium and Enterprise plans (where a separate callback flow is not required, therefore was not created), follow these additional steps:

  1. Edit the flow.
  2. On the left, below the Export PDF action, click Add step ("+" icon) → Controls → Delay until.
  3. At the Event field, select Webhook received.
  4. At the Time out period field, set 10 minutes.
  5. At the top, click Save.
  6. Click the Generate webhook section to open it.
  7. Click the regenerate icon ("⟲" on the right side of the Secret field), then the Regenerate button.
  8. Copy the value of the Secret field and paste that to the Secret field of the Export PDF action. (Also save it somewhere safe as it will be unreadable once you leave this step.)
  9. Copy the value of the URL field and paste that to the URL field of the Export PDF action.
  10. At the top, click Save again.
  11. You're done!

How to know which Jira site and which automation flow sent an email?

If you use multiple Jira sites, or you have multiple automation flows to send emails, or you received an unexpected email, it can be useful to identify the sender. To help with this, each email sent by the app contains the following custom email header fields.

Header field name Value (example) Description
X-Midori-Base-Url https://mysite.atlassian.net The base URL of the Jira Cloud site on which the automation flow which sent this email was executed.
X-Midori-Client Every morning, email the task list The name of the automation flow which sent this email. (It is essentially the value of the client field from the automation request body.)

Questions?

Ask us any time.