All eazyBI for Jira eazyBI for Confluence Private eazyBI

Report results export API

eazyBI provides a report result export URL that you can use in applications and tools to execute the specified report and download the report results

When using eazyBI for Atlassian Data Center or Private eazyBI, please set export to PDF to enable PDF and PNG formats.

Please replace the JIRA_BASE_URL as well as the following parameters:

If your reports contain page filters you can dynamically set value for those filters by passing the value in URL.

If you want to filter report rows when exporting the report, you can pass down the filter condition to URL.

At first, test the report results export in your browser and see if it returns expected results. If you would like to automate report results export requests from other applications, then you need to provide authentication information for these requests.

Note this export API works for retrieving report data but does not work for a dashboard. More details on options to download dashboard data read here: Create dashboards.

Authentication

Report results export API support either HTTP Basic authentication or embed report token authentication.

Make the request using Basic authentication with your Jira / Confluence username and password. Jira / Confluence will validate the username and password and eazyBI will validate if this user has access to the eazyBI account and the specific report.

Make the request using Basic authentication for REST API with your Atlassian account email and API token. This is supported only for applications and tools (e.g., curl) that support authentication.

If you have shared the report with a public token then you can add the request parameter ?embed_token=... with the corresponding generated token to authenticate the result export request.

When using basic authentication in scripts, it is recommended to use a separate user with limited read-only access rights, as this user's password or API token will be stored in those scripts.

When creating an API token in Atlassian Cloud, it is recommended to create a separate token with a meaningful name (e.g. eazyBI). Then it will be possible to see when this token was used and revoke it if not needed anymore.

MultiPass authentication for Private eazyBI

Please see MultiPass authentication documentation on how you can set up and create MultiPass tokens.

You can use MultiPass authentication if you would like to create automated scripts which download eazyBI report results:

  1. When creating the MultiPass token, you need to include in it to attribute which is relative URL of the results export:
    /eazybi/accounts/account_id/export/report/report_id.format
  2. Make the request to the following URL (replace the site_key with the corresponding name you used in eazybi.toml):
    <eazyBI host and port>/eazybi/users/multipass/site_key?multipass=multipass_token
  3. After successful authentication, the request will be redirected to the report results export URL.

Sample node.js script

At first, you need to

Then create the attached script file eazybi-export-results.js and update in it Jira base URL and basic authentication parameters. Then use it in the following way:

node eazybi-export-results.js account_id report_id format

and replace account_id, report_id and format as described in the overview. Report results will be written to the standard output, save it to a file if needed.

eazybi-export-results.js
#!/usr/bin/env node

// For Jira Data Center
var baseURL = "...";
var eazybiBaseURL = baseURL + "/plugins/servlet/eazybi";
// For Jira Cloud
// var eazybiBaseURL = "https://aod.eazybi.com";

var accountId = process.argv[2];
var reportId = process.argv[3];
var format = process.argv[4] || "csv" // other available formats: json, pdf, png

// Provide user and password for Jira Data Center or user email (as user) and API token (as password) for Jira Cloud
var options_auth = {
  user: "...",
  password: "..."
}

var Client = require('node-rest-client').Client;
client = new Client(options_auth);

if (!accountId) {
  throw "Missing account ID argument";
}

if (!reportId) {
  throw "Missing report ID argument";
}

// Set if using self-signed SSL certificates which should not be validated
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

client.get(eazybiBaseURL + "/accounts/" + accountId + "/export/report/" + reportId + "." + format,
  function(data, response) {
    if (response.statusCode == 200) {
      if (format == "csv") {
        console.log(data.toString("utf8"));
      } else if (format == "json") {
        console.log(JSON.stringify(data, null, '  '));
      } else {
        process.stdout.write(data);
      }

    } else {
      console.log("Error code", response.statusCode);
      throw "Export report results request failed";
    }
  }
);