Get macro usage details in Confluence Cloud using CQL, Postman, and JSON-to-CSV conversion

Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.

Summary

Learn how to get the macro usage details via CQL with Postman and convert JSON to CSV.

Solution

CQL API

Use the below CQL API call via Postman as a workaround:

https://YOUR_INSTANCE.atlassian.net/wiki/rest/api/content/search?cql=type=page AND macro in ('macro_name1','macro_name2')&limit=10000&start=0

Postman files to import

CQL macro usage

{ "info": { "_postman_id": "cb1b578c-9174-4647-9c49-7ef317d9b7ca", "name": "CQL macro usage", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "25367731" }, "item": [ { "name": "macro usage", "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{api-token}}", "type": "string" }, { "key": "username", "value": "{{username}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "https://{{site-name}}/wiki/rest/api/content/search?cql=type=page AND macro in ('{{macro-name}},{{macro-name}}')&limit=10000&start=0", "protocol": "https", "host": [ "{{site-name}}" ], "path": [ "wiki", "rest", "api", "content", "search" ], "query": [ { "key": "cql", "value": "type=page AND macro in ('{{macro-name}},{{macro-name}}')" }, { "key": "limit", "value": "10000" }, { "key": "start", "value": "0" } ] } }, "response": [] } ] }

MacroUsage

{ "id": "db7351f4-90b2-44f4-b7c6-c75cc23db291", "name": "MacroUsage", "values": [ { "key": "site-name", "value": "Your site's base URL", "type": "default", "enabled": true }, { "key": "username", "value": "Your email address", "type": "default", "enabled": true }, { "key": "api-token", "value": "Your API token", "type": "default", "enabled": true }, { "key": "macro-name", "value": "macro-name (Case sensitive)", "type": "default", "description": "", "enabled": true } ], "_postman_variable_scope": "environment", "_postman_exported_at": "2025-08-28T05:12:17.498Z", "_postman_exported_using": "Postman/11.60.3" }

Steps

  1. Download Postman.

  2. Copy and save both JSONs above.

  3. Import the JSON files to Postman.

  4. Export the CQL response JSON.

  5. Import JSON to Excel via Power Query.

    1. In the Get Data selection, select the JSON option. This launches a local file browser where you can select your JSON file.

    2. Select Open to open the file.

      A File Explorer window open to the "JSON Samples" folder. Two JSON files, are displayed with their modification dates, types, and sizes. The file name input field and "Open" and "Cancel" buttons are visible at the bottom.
    3. Loading the JSON file automatically launches the Power Query editor. Power Query uses automatic table detection to flatten the JSON data into a table seamlessly. You can continue to transform the data from the editor if you want, or you can close and apply. More information: Automatic table detection from JSON files.

      Power Query Editor displays data from the TailSpinToys1 JSON file. The table shows data and column headers. The right pane lists the applied query steps.
    4. Then you can get the detailed macro report for the specific macro usage and save it to CSV.

Feature requests

To improve upon this situation, we have outlined the following feature requests to address these issues:

Updated on September 25, 2025

Still need help?

The Atlassian Community is here for you.