Elements Connect

How to configure a Confluence attachment as a datasource (JSON file)

Prerequisites:

  • Have a Jira Cloud instance.

  • Have Elements Connect installed on your Jira instance.

  • Have a Confluence Cloud instance (on the same Jira site or remotely).

  • Have a JSON file attached to a Confluence page.

Steps

Generate an API token

Elements Connect configuration

Datasource configuration

  • Go to the Elements Connect administration menu

  • Go to the Data sources tab

  • Create a new REST API datasource and configure it as follows:

    • API Base URL:

      https://YOUR_CONFLUENCE_BASE_URL.atlassian.net/
      
    • API Test URL:

      https://YOUR_CONFLUENCE_BASE_URL.net/wiki/rest/api/user/current
      

      info Replace YOUR_CONFLUENCE_BASE_URL based on your own Confluence site.

  • Authentication:

    • Mode: API Key (Send in Request Header)

    • Header name:

      Authorization
      
    • API KEY:

      Basic <YOUR_BASE_64_ENCODED_TOKEN>
      

      info Replace <YOUR_BASE_64_ENCODED_TOKEN> with the Token generated above.

  • Then, click "Save" and "Test Connection":

    image-20260910-090718.png

Field configuration

To determine the endpoint to use, you need the following information:

  • The ID of the Confluence page containing the attachment.

  • The ID of the attachment.

Find the Confluence page ID

You can find the Confluence page ID in your web browser's address bar, as shown below.

image-20260915-121917.png
Find the attachment ID

Once you have the page ID, enter the following URL in your browser's address bar to retrieve the attachment ID:

https:/YOUR_CONFLUENCE_BASE_URL/wiki/api/v2/pages/CONFLUENCE_PAGE_ID/attachments

info Replace YOUR_CONFLUENCE_BASE_URL and CONFLUENCE_PAGE_ID accordingly.

The response should look like this:

image-20260915-124300.png
Configure the Connected field

Once you have identified the Confluence page ID and attachment ID, you can configure the full path in your field configuration:

  • Go to the Elements Connect administration menu

  • Go to the Connected fields tab:

  • Create a Custom field and configure the query tab as follows:

    • Data source: the REST API data source created above

    • Method: GET

    • Path:

      /wiki/rest/api/content/CONFLUENCE_PAGE_ID/child/attachment/ATTACHMENT_ID/download
      

      info Replace CONFLUENCE_PAGE_ID and ATTACHMENT_ID with the appropriate values.

  • Run a test and check that the results are displayed in the Full API Response tab:

    image-20260915-123213.png

The Filter and Display tab configuration may vary depending on the content of the file. Please see the following documentation for a step-by-step guide on how to configure a field: https://doc.elements-apps.com/elements-connect-cloud/connected-custom-fields-settings#How-to-configure-connected-custom-fields