The following variables are automatically available in the script. Refer to the Confluence API documentation for how to use these many of these variables.
All macro parameters are also defined as variables for the script.
Variable, Available, Discussion
out, All, Standard output - stdout. It is a java.io.PrintWriter. Use to output macro result. Do not use System.out
err, All, Standard error - stderr. It is a java.io.PrintWriter. Shown if showErrorOutput=true
context, All, PageContext for the current page
contentEntityObject, All, ContentEntityObject for the current content
request, All, http servlet request
session, All, http servlet session
contextPath, All, String representing the context path
confluenceHome, All, String representing path to confluence home directory
confluenceDomain, All, String representing base url for this instance.
userAccessor, All, Since 4.3
webResourceManager, All, Since 4.1
conversionContext, All, Since 4.0
xhtmlContent, All, Since 4.0
Gant, Groovy markup builder
Looking for something else
Open an issue if you would like to see additional variables provided. This list is occasionally updated make it easier to write simple scripts. The following technique can also be used to get access to additional Confluence components: