How do I produce a list of all attachments and the pages they are attached to?

I need to produce a list of all attachments in Confluence, and the pages they are attached to.  I am attempting to pull this information from the database, but cannot see a way to join the ATTACHMENTS table to the CONTENT table.

I cannot use the listing of attachments in the Content Tools section of a space, because I need this information exported to Excel.

3 answers

Hi Jason,

In fact I also don't see any method to join the Attachments and Content tables from the database, however, this tables have been merged since Confluence 5.7. Now attachments are listed on the "contenttype" column from the Content table, so you would be able to query all content where the contenttype column is an attachment. Below is an example query for that:

SELECT * FROM CONTENT WHERE contenttype LIKE 'ATTACHMENT'

I'm not sure if it would be feasible for you to upgrade Confluence to 5.7 or later, however it's the only workaround I see for that.

Thanks.

Regards,
LM

Thank you for your answer Luiz.  Unfortunately, I cannot upgrade my Confluence instance right now, so it appears that I am out of options, which is dissappointing.  I appreciate your reply though.

You can use the Confluence Command Line Interface (CLI) to produce lists of attachments in CSV format that you can import into Excel. Use the getAttachmentList action.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

97 views 0 6
Read article

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