Configure a REST API datasource for Custom Reports

Overview

This article explains how to add and configure a new datasource for Custom Reports.

 

 

Add a Datasource

  1. From Dashboard Hub, click and select Add Datasource. The datasource selection window displays.

  2. Select Custom Report. The Custom Report configuration form displays.

    1. Provide a descriptive name for the datasource.

    2. Enter the URL of the REST API you want to connect to for fetching data (that is, the URL of the product providing the content for your report)

    3. Select an authorization type (see Authentication types in Custom Reports datasources) and enter any required values for that selection. Basic Auth is recommended for this purpose.

  3. Click Add to create the datasource.

image-20241212-010526.png

 

 

Add a Custom Report

  1. From your dashboard, add a Custom Report.

  2. In the configuration window, select Load Template if you already have a saved report. Or create one with the provided content to list issues from a Jira datasource.

  3. Select the datasource added previously. In the provided example, you need to add a Jira datasource and a JQL query Jira in the provided example.

  4. Click Open Editor. The JSON for the fields in the datasource displays and can be configured.

 

Download the JSON descriptor here:

 

 

Jira issues example. Descriptor to list Jira issues in a table:

{ "type": "rest", "uri": "datasource://jira/rest/api/3/search?jql={$initial.jql}&maxResults=5", "children": [ { "type": "table", "path": "issues", "columns": [ { "header": "Issue", "accessor": "key" }, { "header": "Summary", "accessor": "fields.summary" }, { "header": "Status", "accessor": "fields.status.name" } ] } ] }

 

 

Configure the datasource

  1. The uri section starts with datasource://[YOUR_DATASOURCE_VARIABLE_NAME], in our example, jira and following, the rest of the URI rest/api/3/search . Select your previously created datasource from the dropdown. In our example Jira Cloud datasource.

  2. Optionally, you can define variables to pass to your request. In the Jira example, the variable {$initial.jql} which is used in the query as a parameter jql={$initial.jql}. Then, in the input field for our variable jql we are using issuetype = Bug as an example.

  3. The response from the API will be mapped to a table.

  4. Define the columns in the table by mapping attributes and fields returned by the API:

    • key: maps to the issue key.

    • fields.summary: maps to the issue summary field.

    • fields.status.name: maps to the issue status name.

  5. Save the report configuration.

 

 

Jira_list_issues_editor.jpg
Editor view: Jira datasource with a variable “jql”

 

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.