Listing All Available Spaces

Scenario

A simple use case for Reporting would be to find all spaces on your Confluence. 

This recipe displays a list of all available spaces in the Confluence instance and sort it alphabetically.

Result

 

Recipe

Apps

Reporting for Confluence Server & Data Center

Apps

Reporting for Confluence Server & 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:

 

 

Steps

Line

Description

Line

Description

1

The report will be formatted as a table with Report Block.

2

Space Reporter retrieves all spaces within Confluence.

3

Text Sort is used to sort the table by space name, keychain: 'space:name'.

4

Report Body is used as a container for displayed contents.

5

Report Info here outputs a link to the individual space, by setting supplier key to 'Space Supplier'. Link parameter is set to 'true'.

6

Report Info here outputs the space key, by setting supplier key to 'Space Supplier'.

 

Line-by-Line Explanation

  • N/A