The Adaptavist Group LogoDocumentation

Work with Page Components

Learn about using HAPI to complete tasks associated with page components.

Use HAPI to easily work with Confluence content like attachments and comments!

Attachments

Get all attachments of a page

You can get all attachments of a page using a script like this:

def attachmentIterator = Pages.getById(16252929).getAttachments()
def attachments = []
while (attachmentIterator.hasNext()) {
 def nextAttachment = attachmentIterator.next()
    attachments.add(nextAttachment.title)
}
attachments

The results look like this:

You can customize this script by replacing the page ID.

Search documentation

Start typing to search the docs.