Hello,
I was wondering, if it is possible to get an overview of all pages, where one attachment is linked to.
I'm currently facing the issues, when deleting an attachment, it may be used in some other page too. When i delete a page, I do get the information where the page is set as a link, means I do know which pages i have to check.
Anybody had the same issue?
Thanks for your help.
Best,
Frederik
@James Dellow has answered a similar question here: https://community.atlassian.com/forums/Confluence-questions/Re-How-do-I-identify-which-pages-an-attachment-is-associ/qaq-p/662209/comment-id/88817#M88817
His solution certainly is not a to-be-sure-100% approach, especially if the name of the image is often "my-image.png", but it may be worth a try to get started.
I encountered some difficulties in case the filename contains dashes or spaces. So you may want to quote them, for instance
"photo - cats in spring.png"
You may also find the pages by using the attachment ID. Just paste the ID (you can extract them from the attachment URL on the "Attachments" page of the Confluence page). Again, there may be false positives.
The following may also be useful, where the number is the ID of the attachment (in this case you very likely do not get pages where the ID's number is used in another context):
"data-linked-resource-id=\"46793026\""
For some reason the following has better results on our server (version 9.2 LTS, again mind the quotes):
"data-linked-resource-id=46793026"
One caveat: I am not sure what types of information are referenced by the data attribute. Maybe you find by chance a referenced user with that ID. So this may not be a solution for automation. :-)
For the few times I have need it, it provided good enough results. For a bullet proof approach you may want to have a look directly at the database or create a script or app that uses the designated Confluence internal services.
Look at this posts, maybe can help you
https://confluence.atlassian.com/doc/manage-files-139415.html
https://confluence.atlassian.com/doc/attachments-macro-97911315.html
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.