Event listener for page version restore

We want to perform some operations while the page version is being restored. Is there an event getting triggered when restoring the page version?

Hello @ShahPrerak

There are indeed events you can listen for when restoring content in Confluence.

  • We have events triggered when restoring content from trash (via Space tools > Content tools > Trash)
    PageRestoreEvent and BlogPostRestoreEvent
  • We also have events triggered when “reverting” content to a previous version, this one applies to both page and blog types

Below is a simple event implementation

import com.atlassian.confluence.event.events.content.ContentRevertedEvent;
import com.atlassian.confluence.event.events.content.blogpost.BlogPostRestoreEvent;
import com.atlassian.confluence.event.events.content.page.PageRestoreEvent;
import com.atlassian.event.api.EventListener;
import com.atlassian.event.api.EventListenerRegistrar;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public class ContentEventsListener implements InitializingBean, DisposableBean {

    private final EventListenerRegistrar eventListenerRegistrar;

    public ContentEventsListener(final @ComponentImport EventListenerRegistrar eventListenerRegistrar) {
        this.eventListenerRegistrar = eventListenerRegistrar;

    public void handlePageRestored(final PageRestoreEvent event) {
        System.out.printf("**** restored from trash %s\n", event);

    public void handleBlogRestored(final BlogPostRestoreEvent event) {
        System.out.printf("**** restored blog from trash %s\n", event);

    public void handleContentReverted(final ContentRevertedEvent event) {
        System.out.printf("***** restored content version from history %s\n", event);

    public void afterPropertiesSet() {

    public void destroy() {

I hope this helps !

Hasnae R.
former Confluence person