Documentation for JIRA 4.3. Documentation for other versions of JIRA is available too.
リスナーはJIRAで固有であり、拡張するのにとても強力な方法です。
JIRA has a complete event subsystem which fires events whenever anything happens inside the application. For example an ISSUE_CREATED
event is fired whenever an issue is created.
A Listener is a class that implements one of the Listener interfaces. It is then called whenever events occur in JIRA. Using those events, you can then perform any action you want. For example the email sent by JIRA is driven by the MailListener.
リスナーは、JIRA内で発生するイベントから外部システムに影響を与えたいときに最も便利です。
On this page:
There are currently two different concrete Listeners within JIRA (both of which extend the base JiraListener interface).
com.atlassian.jira.event.JiraListener |
The base interface which all other JIRA listener interfaces extend. Covers core listener properties like uniqueness, description, parameters etc. |
com.atlassian.jira.event.issue.IssueEventListener |
The main listener interface in JIRA, used whenever anything happens to an issue. |
com.atlassian.jira.event.user.UserEventListener |
This listener is called whenever anything happens to a user within JIRA. |
The examples provided may be freely used and modified for use in your own environment. The source of all examples is available and should give you good overview of how simple it is to write your own listeners. Both example listeners are included with JIRA 2.1, and both implement UserEventListener
and IssueEventListener
.
com.atlassian.jira.event.listeners.DebugListener
.リスナーで実現できるその他の便利なタスクの例:
リスナーを登録するには、次の手順に従います。
WEB-INF/classes
or WEB-INF/lib
(as a JAR) directories within the JIRA web application.You can edit a listeners properties by clicking 'Edit' for that listener in the 'Listeners' section of the 'Administration' tab.
When defining your own Listener, there is a method getAcceptedParams
to overload for defining the parameter names, pass as an array of String objects. The DebugParamListener
class is an example of doing this.
To remove a listener, click 'Del' for that listener in the 'Listeners' section of the 'Administration' tab.
With the ability to add custom events to JIRA, the Listener must be updated to deal with the event as appropriate. This is possible by providing an implementation for the method customEvent(IssueEvent event)
in the Listener. For example, the MailListener implementation passes the custom event on for notification processing. The DebugListener logs that the custom event has been fired.