Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can Super Admin CQL query pages that use a certain macro even on a page with restrictions?

Joshua May May 10, 2023

Trying to identify all pages on our Confluence instance that use the digi formatting macro and remove the macros since we are not purchasing it this coming year.

This could be the digi-accordion, digi-button, etc.

I have a CQL query to search ' type = Page AND macro = "digi-accordion" '

However, it is only showing pages I have direct access to that use the macro. I have super admin for confluence and would like to search through restrictions to find any instances that are hiding from me. I know for a fact there are more than I see as a fellow admin sees 1 extra then me and has confirmed it is due to restrictions on that page not giving me view permissions. 

How do I bypass restrictions on a CQL query?

1 answer

0 votes
Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2023

Is the count available through the Admin Macro Usage section different for each of you?
https://<confluence-url>/admin/pluginusage.action

Another option for you, if you have access to query the DB itself, is to perform this query:

/* MySQL */
select c.CONTENTID, c.CONTENTTYPE, c.TITLE, c.LASTMODDATE, s.SPACEID, s.SPACEKEY, s.SPACENAME
from confluence.content as c
join confluence.bodycontent as bc on c.CONTENTID = bc.CONTENTID
join confluence.spaces as s on c.SPACEID = s.SPACEID
where bc.BODY like '%ac:name="digi-accordion"%'

I don't know for sure if the macro name is "digi-accordion" but that can be found by reviewing the page's storage format.

Nicolai Sibler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2023

@Matt The Macro Usage Page is based on CQL as well - follow any link and check the URL of the search results page ;-)

@Joshua May I'm not aware of any way to trick CQL. Best to hand over the SQL provided by Matt to your fellow DBA.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events