In this page

Get started

This page contains the basics of configuring Excel automation on the Jira Cloud platform. If you're about to create your first Excel automation flow, we recommend the following learning path:

  1. Learn the key concepts and basics of Jira Cloud automation.
  2. Learn about the execution sequence of Excel automations.
  3. Configure the Excel callback flow, a shared automation flow commonly used by all Excel automations.
  4. Configure your first Excel export flow, the automation flow that implements an actual Excel automation.
  5. Study the configuration reference for the complete list of configuration options.

Let's get started!

Execution sequence of Excel automations

Excel automations are implemented by integrating the Excel Automation API with Jira automation flows. The Excel Automation API is a secure REST API published by the Better Excel Automation for Jira app. You can connect to this from any Jira automation flow using the built-in connections.

A complete automation requires a pair of automation flows, each with its well-defined responsibility:

  1. The Excel export flow is the flow that actually calls the Excel Automation API. It requests exporting the Excel spreadsheet file, and emailing or attaching that. It will not wait for the completion of the work, but let the API asynchronously do what was requested.
  2. The Excel callback flow is the flow that listens for the result. It is called "callback", because it is "called back" by the Excel Automation API with the result after the API completed the work requested. It writes the details of the result to its audit log for troubleshooting and auditing reasons, and switches to "Success"/"Some errors" state to reflect the state of the complete automation.

The execution sequence:

  1. The trigger of the Excel export flow kicks off the flow's execution. (Note that you can use any of the triggers to start Excel automations!)
  2. The Excel export flow sends a request to the Excel Automation API. (The request body specifies what to export to Excel and also what to do with the exported file.)
  3. The API validates the request and responds to the Excel export flow. The response includes an ID that identifies the request and the validation result (accepted/rejected).
  4. If the request was accepted, the API starts working on it asynchronously.
  5. The Excel export flow writes the response to its audit log.
  6. The Excel export flow ends.
  7. Meanwhile, the API exports the Excel file, and emails that to the requested recipients or attaches that to the requested work item.
  8. The API "calls back" by sending a request to the incoming webhook type trigger of the Excel callback flow. (The request body includes the original request ID and information about the result.)
  9. The trigger of the Excel callback flow kicks off the flow's execution.
  10. The Excel callback flow writes the request to its audit log. (Note that the request ID is the "link" between the matching Excel export flow and Excel callback flow in the audit log.)
  11. The Excel callback flow turns to "Success" state if the request body contains that the API successfully completed the work. It turns to "Some errors" otherwise.
  12. The Excel callback flow ends.
  13. The automation ends!

Configure Excel automation flows

In this section you can find step-by-step guides that ease building the two types of Excel automation flows.

Recommended order:

  1. Start with configuring the Excel callback flow. It should be configured first, because it will generate a unique webhook URL and a secret that will be necessary for configuring the Excel export flow.
  2. Having the webhook URL and the secret, continue with configuring the Excel export flow.

Configure the Excel callback flow

For Jira Cloud Premium and Enterprise plans, a separate callback flow is not required. The callback logic can be included directly in the export flows.

The Excel callback flow is a simple flow that can be triggered by a webhook URL. It does nothing else, but writes to the audit log and reflects the result of the work done by the Excel Automation API:

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 Incoming webhook trigger.
  5. Click Next → Action.
  6. Select the Log action (not Log work!) and copy this to Log message (don't worry if it is long and hard to read):
    {{#webhookData.successful}}
    Excel automation successfully completed. (ID: {{webhookData.messageId}}, client: "{{webhookData.client}}", filename: "{{webhookData.fileName}}")
    {{/webhookData.successful}}
    {{^webhookData.successful}}
    {{#webhookData.exportSuccessful}}
    Failed to execute action with the Excel document: {{webhookData.actionResult}} (ID: {{webhookData.messageId}}, client: "{{webhookData.client}}", filename: "{{webhookData.fileName}}")
    {{/webhookData.exportSuccessful}}
    {{^webhookData.exportSuccessful}}
    Failed to render the Excel document! (ID: {{webhookData.messageId}}, client: "{{webhookData.client}}") {{webhookData.message}}
    {{/webhookData.exportSuccessful}}
    {{/webhookData.successful}}
    
  7. Click Next → Action.
  8. Select the Create variable action and:
    1. Enter "successful" to Variable name.
    2. Copy this expression to Smart Value:
      {{#=}} 1 / {{webhookData.successful}} {{/}}
      Note that the expression will evaluate to 1 if the original Excel export flow was successful, or will cause a division-by-zero error and make the Excel callback flow fail if the original Excel export flow failed. This trick is there to have the callback flow's "Success"/"Some errors" status reflect the result of work done by the Excel Automation API.
  9. Click the "…" icon in the top right corner and select Flow details.
  10. Enter "Excel automation callback" 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. At the top, on the right side of the Save and enable button, click the "down arrow" ("˅" icon) → Save without enabling.
  13. Click the Incoming webhook trigger on the left.
    1. Note that this flow can be triggered by sending a request the unique URL shown at Webhook URL and authenticating the request with the token shown at Secret. Therefore, you will need these two values when configuring any future Excel export flow.
    2. If your Webhook URL starts with https://automation.atlassian.com/pro/hooks/..., your site is using the legacy Incoming webhook trigger. For those, there is no Secret shown. Therefore, you can completely omit the secret when configuring any future Excel export flow. In this case, skip the next step.
    3. Click the regenerate icon ("⟲" on the right side of the Secret field). (Copy the secret and save it somewhere safe as it will be unreadable once you leave this step.)
  14. From the Work item criteria options, select No work items from the webhook.
  15. Click Save at the top and enable the flow.
  16. Click Return to flows ("←" icon in the top left corner of the editor).
  17. You're done!

Notes:

  • Consider the Excel callback flow as a shared resource: a single Excel callback flow can be used by all your Excel export flows! It contains no logic that is specific to a concrete automation, therefore it is perfectly reusable. (If you prefer a separate Excel callback flow dedicated to each Excel export flow, that model also works.)
  • Although this guide is written to implement the "bare minimum" callback flow, you can add further actions or conditions to customize or refine its behaviour.

Configure the Excel export flow

After the Excel callback flow has been configured, see the step-by-step guides for specific automations:

  1. Send Excel spreadsheets automatically
  2. Attach Excel spreadsheets automatically
Generate the "Export" section for the Excel Automation API call

While creating an Excel export flow, you will notice that every flow requires sending a precisely-crafted request to the Excel Automation API. The action config form contains a section named "Export", which specifies the identifiers of the Excel view, saved filter, Scrum board, etc., depending on what data you want the automation flow to re-export and process.

Manually collecting the identifiers may be time-consuming and error-prone, but there is an easier way! Basically, after manually exporting the data, a ready-made YAML fragment will be generated for you with all required identifiers:

You can then simply import this fragment in your export flow's action config form!

Steps:

  1. Go to the data you want the automation flow to export in the future.
    (It can be a single work item, work items resulted from a JQL search, work items resulted from a saved filter, work items from a Scrum board, etc.)
  2. Export the data choosing the Excel view you want the automation flow to use in the future.
  3. Ignore the exported file.
  4. Click View Excel automation tips at the bottom part of the dialog.
  5. Copy the YAML fragment.
  6. Edit your export flow.
  7. Click the import icon in the top right corner of the "Export" section.
  8. Paste the previously copied fragment to the text field.
  9. Click Apply.

Note that this mini-guide is referenced from the step-by-step guides of each automation flow.

Legacy app versions that used YAML configuration required the fragment to be inserted to the export: section of the request body.

Questions?

Ask us any time.