You need to have administrator access in order to get to the CloudScript page
Go to the marketplace and click on "Free Trial".
Today we have access to a simple API, but this is enough to perform advanced tasks.
require` is limited to a few modules: "
bluebird" and "
lodash", documentation for those can be found online at https://github.com/request/request, https://github.com/petkaantonov/bluebird and https://lodash.com/. If you are new with Promise, we recommend the excellent Promise anti-patterns.
All the methods described on the Confluence REST documentation are available to the script. Scripts are prefixed with the
"use strict" directive so you don't need to include it.
Three objects are available in the context of the script execution:
httpClient, this is a modified request object which is preconfigured to access your confluence instance when the path has no host component, method available:
get, post, put, delete, head, patch. Methods have also been promisified, so you can chain them with `
result, this a holder so you can provide result, the promise property is looked at to figure out when the script has finished its execution, it should be assigned to the result of the first call to httpClient.[method].
console, this is replacement for the usual console to capture output written to
console.log. If you need object serialisation, you need to call
JSON.stringifybefore calling console.log.
The UI provides access to the list of predefined scripts and a script editor.
When you click on the name of a provided script, it will load in the editor.
The editor is capable of undo/redo, even after a new script has been loaded.
The execute button will upload the script to the server and execute it in a secured environment.
The result panel at the bottom will either display the outcome of the execution either successful of the resulting error.
We will soon add the ability to save your own scripts, but for now you will have to store them outside of the plugin (on Bibutcket for example).
What are the limitations?
The main limitation is due to the what you can do with the Confluence REST API. For example there is no way to access permissions through the REST API, meaning all content created will belong to the CloudScript user and today there is no documented way to programmatically restrict content.
The script execution is limited to 5s, after which the script will timeout, we are looking at ways to increasing this timeout while managing the load. And of course memory allocation is also limited.
Scripts are running in an isolated vm, with underlying process access removed. We understand that security is a cat and mouse game and we try our best to constantly increase the security of our execution environment, but if we detect any attempt to hack our environment we will terminate your account.
Recent space activity