Script Console

The script console is a place to run scripts. Using the script console, you can copy and paste or write a script to run in Confluence. You can experiment with the Cloud REST APIs, or you can run one-time scripts. Code run from the script console can make requests back to Confluence using either the ScriptRunner add-on user or the current user.

You find a script editor, similar to the the script console, anywhere you choose to use a custom script option (for example, when adding a listener or scheduled job).

The script console is useful for testing scripts or performing operations that you only want to do once. So if you want a list of all the spaces on your instance and some details about them, you can run a script for that. Or if you want to delete all spaces that were created by a certain person, you can do that. You can also run maintenance scripts that modify something on your instance.

You can perform a lot of these same tasks in different parts of ScriptRunner.

Like all coding fields in ScriptRunner for Confluence Cloud, the script console uses the Code Editor. The editor has autocomplete for the following code: 

  • Groovy
  • Atlassian REST API
  • Automatically available variables

You can see autocomplete in the following screenshot: 


Use the Script Console 

To use the script console, follow these steps: 

  1. Navigate to Confluence Administration by selecting the Cog button at the top right of the screen. 


  2. Select Script Console, under ScriptRunner.


  3. Enter the script you want.

    Tips for using the Script Console

    • Some example scripts can be found below the editor box (click one to auto-fill), but you can also write and run your own.
    • Use the Expand button () to have more room for scripting. 
    • To exit the full screen, press F11 or Esc twice when the cursor is in the editor. 
  4. Choose the user you want to run the script for Run As

    Script console can make requests back to Confluence using either the ScriptRunner add-on user or the user that performed the action to cause the event to be fired. Therefore, you can choose whether the creator of a specific action is the current user or a generic ScriptRunner add-on user using the Run As field. 

  5. Select Run.


On this page