public interface

ProjectCreateHandler

com.atlassian.jira.project.ProjectCreateHandler

Class Overview

Interface to be implemented by clients who wish to be notified when a project is created.

Implementations of this class need to be registered through register(ProjectCreateHandler) for the notifications to be triggered.

Summary

Public Methods
String getHandlerId()
Returns a unique identifier for the handler.
void onProjectCreated(ProjectCreatedData projectCreatedData)
Method called every time a project is created.
void onProjectCreationRolledBack(ProjectCreatedData projectCreatedData)
This method will only be called if the creation of the project is rolled back.

Public Methods

public String getHandlerId ()

Returns a unique identifier for the handler.

Returns
  • A unique identifier for the handler.

public void onProjectCreated (ProjectCreatedData projectCreatedData)

Method called every time a project is created. This gives the opportunity for plugins to execute some logic once the project has been created. If this method throws any exception, then the update will be vetoed. All other handlers that have already been called will now have their onProjectCreationRolledBack() methods called.

Parameters
projectCreatedData Object encapsulating the information about the recently created project.
Throws
CreateException An exception if something went wrong.

public void onProjectCreationRolledBack (ProjectCreatedData projectCreatedData)

This method will only be called if the creation of the project is rolled back.

That could happen if one of the ProjectCreateHandler returns an error on #onProjectCreated(Project)

On this method, the handler should undo all of the changes made by it when #onProjectCreated(Project) was called. The parameters passed to this method will be exactly the same as the ones when #onProjectCreated(Project) was called.

Parameters
projectCreatedData Object encapsulating the information about the recently created project.