Going Stellar

Home/Confluence storage format reference

Confluence storage format

Reporting macros in Confluence storage format

Report macros build a list from content that lives on the site: pages with a label, recent updates, attachments, tasks, decisions or page history. They render live content from the site, so the rendered views of several probes were replaced by a marker text. Storage holds only the macro name and its filter parameters.

Storage format

<ac:structured-macro ac:name="content-by-label"><ac:parameter ac:name="labels">demo</ac:parameter></ac:structured-macro>
<ac:structured-macro ac:name="recently-updated"></ac:structured-macro>
<ac:structured-macro ac:name="recently-updated"><ac:parameter ac:name="spaces">@self</ac:parameter></ac:structured-macro>
<ac:structured-macro ac:name="attachments"></ac:structured-macro>
<ac:structured-macro ac:name="tasks-report-macro"></ac:structured-macro>

In the editor

HowNote
Type /filterbylabel and select Filter by labelPer the Atlassian documentation.
Type /recentupdates and select Recent updatesPer the Atlassian documentation.
Use the + toolbar button and find the attachments macro by namePer the Atlassian documentation.

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

<ac:structured-macro ac:name="recently-updated"></ac:structured-macro>
{
 "type": "doc",
 "content": [
  {
   "type": "extension",
   "attrs": {
    "extensionType": "com.atlassian.confluence.macro.core",
    "extensionKey": "recently-updated",
    "parameters": {
     "macroParams": {
      "_parentId": {
       "value": "<page id>"
      }
     },
     "macroMetadata": {
      "macroId": {
       "value": "<id>"
      },
      "schemaVersion": {
       "value": "1"
      },
      "title": "Recent updates"
     }
    }
   }
  }
 ],
 "version": 1
}

Examples

Storage format sent

<ac:structured-macro ac:name="content-by-label"><ac:parameter ac:name="labels">demo</ac:parameter></ac:structured-macro>

Lists pages that carry the label demo. The macro is stored with its labels parameter, but the view is the unknown-macro placeholder.

Rendered view (HTML)

<img class="wysiwyg-unknown-macro" src="https://your-site.atlassian.net/wiki/plugins/servlet/confluence/placeholder/unknown-macro?name=content-by-label&amp;locale=en_US&amp;version=2" />

Storage format after the round trip through ADF

<ac:structured-macro ac:name="content-by-label" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="labels">demo</ac:parameter></ac:structured-macro>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="recently-updated"></ac:structured-macro>

Lists recently updated content. The view is withheld because the macro prints page titles from the site.

Rendered view (HTML)

<macro output not published: it lists pages, tasks or people from the site>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="recently-updated" ac:schema-version="1" ac:macro-id="<id>" />

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="attachments"></ac:structured-macro>

Lists the files attached to the page. The view is withheld, and the ADF round trip adds data-layout="wide".

Rendered view (HTML)

<macro output not published: it lists pages, tasks or people from the site>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="attachments" ac:schema-version="1" data-layout="wide" ac:macro-id="<id>" />

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="tasks-report-macro"></ac:structured-macro>

Lists tasks from the site. The view is withheld, and storage returns unchanged.

Rendered view (HTML)

<macro output not published: it lists pages, tasks or people from the site>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="tasks-report-macro" ac:schema-version="1" ac:macro-id="<id>" />

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="change-history"></ac:structured-macro>

Shows the change history macro of the page. The view is withheld, and storage returns unchanged.

Rendered view (HTML)

<macro output not published: it lists pages, tasks or people from the site>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="change-history" ac:schema-version="1" ac:macro-id="<id>" />

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="decisionreport"></ac:structured-macro>

Lists decisions found in the site. The view is a table with the columns Title and Decisions and the row 'No decisions found'.

Rendered view (HTML)

<table class="aui tasks-table-sortable mytasks conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="decisionreport">
    <thead>
    <tr class="tablesorter-headerRow">
        <th>
            Title
        </th>
                        <th>
            Decisions
        </th>
    </tr>
    </thead>
    <tbody>
                <tr>
                        <td colspan="2">
                No decisions found
            </td>
        </tr>
            </tbody>
</table>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="decisionreport" ac:schema-version="1" ac:macro-id="<id>" />

Sent to Confluence Cloud on .

What changes in conversion

  • The macros stay macros. Each one becomes an extension node with its parameters under macroParams, and comes back as the same ac:structured-macro element.
  • attachments gains data-layout="wide" after the ADF round trip, because ADF stores it as a block extension with layout wide. recently-updated, tasks-report-macro and change-history returned without a layout attribute.
  • The ADF of attachments and of decisionreport includes a placeholder icon or image in macroMetadata. That placeholder is part of the ADF only and does not appear in storage.

Pitfalls

  • Report macros render live content from the site: page titles, task text, user names. The views of recently-updated, attachments, tasks-report-macro and change-history were replaced with '<macro output not published: it lists pages, tasks or people from the site>', so no real output is shown for them.
  • content-by-label saved and kept its labels parameter, but the view was the unknown-macro placeholder. No probe tried another spelling of the name, so the reason is not confirmed.
  • An empty report still renders text: the decisions report says 'No decisions found'. Compare the stored macro, not the view, when checking a page.

Questions and answers

Why are some views missing from the examples?

Those macros print real pages, tasks or people from the site, so their views were replaced with a marker text before publication.

Sources

  1. What are macros? (Atlassian Support, Confluence Cloud)
  2. Insert the filter by label macro (Atlassian Support)
  3. Insert the recent updates macro (Atlassian Support)
  4. Insert the attachments macro (Atlassian Support)

Markdown version · All storage format pages