ScriptRunner allows you to respond to Confluence events, via an inline script or a pointer to a file. These responses are called event listeners.
Example event listeners follow:
Ensuring a Jira project exists for a corresponding Confluence space
Sending an email when a space is deleted
Set up a publishing process for new spaces
Adding an Event Listener
Navigate to Confluence Administration by selecting the Cog button and then selecting General Configuration.
In the left menu bar, under ScriptRunner, navigate to Script Event Handlers.
Click Add New Item.
Choose the Custom Event Listener link to use your own scripts to respond to events.
Fill out the following fields:
Note: (Optional) Add a note for your reference.
Events: Start typing to find the event to listen for.
One of the following fields are required for each event listener:
Script File: Enter the path accessible to the file on the server.
Inline Script: Enter any necessary inline script.
Some of the built-in listeners have a default event that they listen for (that cannot be changed) and, as such, do not not have an Events field.
Browse Event Listener Functionality
After you click Create Listener, a search bar appears that allows you to Search ScriptRunner Functionality. Use this search bar to search for available event listeners.
For example, if you’re looking for an event listener that works remotely you could type "Remote" and press Enter. Then, the list of event listeners is narrowed down to only those containing the word "remote" in their title or description.