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 toConfluence Administrationby selecting theCogbutton and then selectingGeneral Configuration.
In the left menu bar, underScriptRunner, navigate toScript Event Handlers.
ClickAdd New Item.
Choose theCustom Event Listenerlink 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 anEventsfield.
Browse Event Listener Functionality
After you clickCreate Listener, a search bar appears that allows you toSearch 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 pressEnter. Then, the list of event listeners is narrowed down to only those containing the word "remote" in their title or description.