I want to collect all attachments of a space using the method of the AttachmentManager:
java.util.List<Attachment> | getLatestVersionsOfAttachments(ContentEntityObject content) |
BHow can I define the content entitiy object (here the space?) to run the method?
My approach is this:
# @noparams #set( $allSpaces = $spaceManager.getAllSpaces() ) #foreach( $s in $allSpaces ) <li>$attachmentManager.getLatestVersionsOfAttachments $s ) #end
BBut this doesn't work.
Probably because $s is of type: https://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/spaces/Space.html which is not ContentEntityObject, but a ConfluenceEntityObject
So, you would need go to pages (page is a ContentEntityObject) using https://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/pages/PageManager.html
Well, $attachmentManager.getLatestVersionsOfAttachments will only get attachments for a ContentEntityObject ... page, blogpost, etc. It will not get you attachments for a space. Another way to get this would be the REST API. You could use the below ...
http://{yourserver}/rest/searchv3/1.0/search?where={spacekey}&spaceSearch=true&queryString=type:attachment
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.