List all available spaces
Scenario
This recipe displays a list of all available spaces in the Confluence instance and sorts them alphabetically.
Result
Recipe
Apps | Reporting for Confluence Data Center |
|---|---|
Level | Intermediate |
Estimated time | 5 minutes |
Macros | Report Block, Report Body, Report Info, Space Reporter, Text Sort |
Suppliers | Space Supplier |
Storage format
You can copy and paste this code into the Confluence Source Editor:
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="184ba119-e470-4247-905c-4b33096f15a8" ac:name="report-block" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="30b59f60-ff5f-4269-8411-45909b09d58e" ac:name="space-reporter" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="27909439-e015-4f98-9caa-a7d81cfbe71c" ac:name="text-sort" ac:schema-version="1">
<ac:parameter ac:name="">space:name</ac:parameter>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="0c6bdebd-1a2a-415c-bd2e-8dec740c545d" ac:name="report-body" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="1cffc561-7dcf-455a-8582-72a3b6cc82dc" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">space:name</ac:parameter>
</ac:structured-macro> (<ac:structured-macro ac:macro-id="611f1f81-d75d-4d33-94fd-d9fac595e4f3" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">space:key</ac:parameter>
</ac:structured-macro>)</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
Macro structure
You can recreate the example in the editor view:
Line-by-line explanation
Line | Description |
|---|---|
1 | The Report Block macro formats the report as a table. |
2 | The Space Reporter macro retrieves all spaces within the Confluence instance. |
3 | The Text Sort macro, with Key: |
4 | The Report Body macro serves as a container for displayed contents. |
5 | The Report Info macro, with Key: |
6 | The Report Info macro, with Key: |