Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Find out which macros are used within a space

Patrick Schneider July 12, 2022

Hi,

I'm trying to find the Macro Usage for a specific Space. Sadly the macroName: * cql doesn't work. Is there another way to list used macros?

 

Best

Patrick

1 answer

1 vote
Patrick Schneider July 18, 2022

For the interested with Database or XML Access:

- get SpaceID

select spaceid from spaces where spacekey = 'SPACENAME';

- get Content with Maco Usage

COPY(
SELECT bc.body,c.spaceid,bc.contentid,c.contentid,c.content_status,c.title
FROM bodycontent bc
INNER JOIN content c ON c.contentid = bc.contentid
WHERE c.spaceid = '123123213' and bc.body ~ '<ac:structured-macro ac:name')
to '/tmp/export.txt';

 - Grep the Export

grep -Po "ac:structured-macro ac:name=\K[^ ]+" export.txt | sort | uniq

 

Alternative to Database is the entities.xml in the Export.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events