Listing pages with Username labels
Scenario
In this recipe we'll report the pages that holds a label that matches the the logged in user.
Result
Recipe
Ingredients
Apps | Reporting |
---|
Platform | Server |
---|
Level | |
---|
Estimated time | |
---|
Macros | |
---|
Suppliers | |
---|
Storage format
You can copy and paste this code into the Confluence Source Editor:
<h4 class="auto-cursor-target">Generating a report of pages that have labels</h4>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="687a3c4b-d8eb-4b8f-8831-0325192030b2" ac:name="report-table" ac:schema-version="1">
<ac:parameter ac:name="maxResults">50</ac:parameter>
<ac:parameter ac:name="injected">true</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="e1ef115a-c940-46d4-b895-7b8d13a0ffed" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="labels">%global:current user>user:name%</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="ab873efa-53b8-4070-9cbb-1462198fa8fe" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">title</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="c27b443f-4660-45f9-a686-363034f499b3" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">page:title</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="ec34038f-1b6a-442f-b43e-deb50c3c84f5" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Label</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="3b0b007c-0405-4e16-9c81-3664e9ac5d7b" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">page:labels> join with ","</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
- Create a Report Table macro.
Set the following parameters as stated:
Injected: True
Max Results: 50
- Insert Content Reporter macro and set the following:
Labels: %global:current user>user:name%
- Create a Report Column macro and give it a Title.
- Within the Report Column macro, create a Report Info macro.
Set Key to "page:title
".
- In the Report Table macro, create another Report Column macro and give it a Title.
- Within the Report Column macro, create a Report Info macro.
Set Key to page:labels> join with ","
.