/
How to get usage information of an app being used in space templates

How to get usage information of an app being used in space templates

This article explains how to get the usage information about an app that is used in space templates.

Instructions

The PAGETEMPLATES table in the Confluence database maintains all the content inside the space specific templates.

  • Run the following SQL query in the Confluence database that fetches the list of pages that uses the required macro: 

    SELECT P.TEMPLATEID, P.TEMPLATENAME, P.CONTENT, P.SPACEID FROM PAGETEMPLATES P join SPACES S where CONTENT like '%ac:name="sql-query"%' AND P.SPACEID = S.SPACEID
    • In this example, the query looks for pages that use the SQL Query macro of the Bobswift SQL for Confluence app.
    • Replace the sql-query text given in Content with the relevant macro name (%ac:name="XXX"%) to be searched within the space template.
  • Use the following query to search for a specific text inside the templates:

    SELECT P.TEMPLATEID, P.TEMPLATENAME, P.CONTENT, P.SPACEID FROM PAGETEMPLATES P join SPACES S where CONTENT like '%sql%' AND P.SPACEID = S.SPACEID
    • In this example, the query looks for pages that contains text, sql.
    • Replace sql given in Content with the relevant text (%xxx%) to be searched within the space template.

Related content