Listing Pages created from Global Templates

Scenario

There may be times when it is useful to look for pages that are created from Global Templates.

If you are planning on migrating to Confluence Cloud, there is a CCMA limitation on migrating Global Templates (Atlassian bug report: MIG-190). So, you will need to convert your Global Templates into Space Templates (more details here) and this recipe may be helpful for you.

This recipe generates a list of pages that are created from Global Templates. To display the list of pages using that template, you will need to provide the name of the Global Template into the report.


Result


Recipe

Ingredients

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Add a Report Table macro.
  2. Within the Report Table macro, add a Content Reporter macro and set Spaces to "@self". 
  3. Inside the Content Reporter macro, add an And Filter macro.
  4. Inside the And Filter macro add a Text Filter and set the following:
    1. Key to content:body>text
    2. Contains Value to live-template
    3. Tick the Required checkbox
  5. Right below the Text Filter, add an Or  Filter and inside it add two Text Filter  macros (to search for multiple Template names) and set the following for each:
    1. Key to content:body>text
    2. Contains Value to GlobalTemplate1 (Change this value to your Global Template name). For the second Text Filter macro, set Contains Value to  GlobalTemplate2.
    3. Tick the Required checkbox
  6. Outside the And Filter macro, add two Text Sort macros and set the following values respectively:
    1. Key to page:modifcation date
    2. Key to page:version comment
  7. Below the Text Sort macros, add two Text Filter macros.
  8. For the first Text Filter macro, set the following values:
    1. Key to page:title
    2. Exclude to .*:.* (This will omit any pages that contain : in their page title.)
  9. For the second Text Filter macro, set the following values:
    1. Key to page:title
    2. Exclude to Page Title (Change this value to the title of the page this report resides on.)
  10. Now, create the table columns below by following these steps:
ColumnSteps
Space

Inside the Report Table macro, add a Report Column macro and set the Title to "Space".
Then add a Report Info macro and set the Key to content:space and Link to True.

Page Title

Add another Report Column macro and set the Title to "Page Title".
Then add a Report Info macro and set the Key to page:title and Link to True.

Created 

Add another Report Column macro and set the Title to "Created".
Then add a Report Info macro and set the Key to content:creation date and set the Format to dd MMM, yyyy.
Then, type "by" and add another Report Info macro. Set the Key to content:creator and Link to True.

Page ID

Add another Report Column macro and set the Title to "Page ID".
Then, add a Report Info macro and set the Key to page:id  and Link to True.

Last Modified

Add another Report Column macro and set the Title to "Last Modified".
Then add a Report Info macro and set the Key to content:modification date and set the Format to dd MMM, yyyy.
Then, type "by" and add another Report Info macro. Set the Key to content:modifier and Link to True.

Last version comment

Add another Report Column macro and set the Title to "Last version comment".
Then add a Report Info macro and set the Key to page:version comment.

LinksAdd another Report Column macro and set the Title to "Links" and set Injected to True.
Then add a Link to Location macro and set Location  to page info and Link Text to "Page Info".
Then add a Link to Location macro and set Location  to page history and Link Text to "Page History".
ActionsAdd another Report Column macro and set the Title to "Actions" and set Injected to True.
Then add a Link to Location macro and set Location  to page edit and Link Text to "Edit" and Content to %title%.
Then add a Link to Location macro and set Location  to page remove and Link Text to "Remove" and Content to %title%.

How to use the report

This report will search through the storage format of all the pages from the current space. It will search for the name of the Global Template defined in the Text Filter macros.

For example, if the name of the global template is GlobalTemplate1 , edit the Text Filter macro and enter the name of the global template in the the Contains Value field to get the list of pages using the template. (See image below.)

  1. This Text Filter macro will make sure that only pages with the Live Template macro are listed.
  2. To search for a global template, edit the Text Filter macro. In the Contains Value field, enter the name of the global template.

    Note

    You may add multiple Text Filters to search for multiple templates at the same time.

  3. This Text Filter is used to exclude the Reporting page from appearing in the results. Because the report is searching through the storage format, and the template name exists on the Reporting page, we add the Reporting page title into the Exclude field. Feel free to change this value according to your Reporting page title.