how to get macro usage report for confluence 5.1.3

Hi,
Earlier version of confluence we run the report for different macro usage. Right now we are using confluence version 5.1.3, how to get the same report.
as an examaple we using run the query like below . Please suggest. it really and urgent requirement.

  

SELECT b.BODYCONTENTID, b.BODY, b.CONTENTID, c.TITLE , c.VERSION, c.CONTENTTYPE, c.SPACEID,  sp.Spacename, sp.SPACEKEY FROM BODYCONTENT AS b INNER JOIN [CONTENT] AS c ON b.CONTENTID = c.CONTENTID INNER JOIN SPACES SP ON SP.SPACEID=c.SPACEID WHERE (b.BODY LIKE '%{macroname%')

 Thanks'

Rinku

2 answers

1 vote
Davin Studer Community Champion Oct 31, 2014

The problem is the b.BODY LIKE '%{macroname%'. You need to specify the new storage format for macros. It should look more like this.

 

SELECT
	b.BODYCONTENTID,
	b.BODY,
	b.CONTENTID,
	c.TITLE,
	c.VERSION,
	c.CONTENTTYPE,
	c.SPACEID,
	sp.Spacename,
	sp.SPACEKEY
FROM BODYCONTENT AS b
INNER JOIN [CONTENT] AS c ON b.CONTENTID = c.CONTENTID
INNER JOIN SPACES SP ON SP.SPACEID=c.SPACEID
WHERE (b.BODY LIKE '%<ac:structured-macro ac:name="macroname">%')

That's exactly what I was looking for. Thanks, mate!

Davin Studer Community Champion Nov 05, 2015

If you are on a newer version than 5.1.3 then you could use the user macro that I created at the below address. It is better than the above query. It requires at least Confluence 5.5. http://iamdav.in/2015/01/06/confluence-macro-usage-report/

0 vote

Hi Rinku,

As far as I know, this query shows all pages that uses this macro. Unfortunately confluence doesn't have a bundled functionality to show the macros.

The query that you listed will work to show the pages that uses the macros.

Cheers,

Rodrigo

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

370 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you