@PublicApi public final class

IssueEvent

extends AbstractEvent
implements IssueRelatedEvent
java.lang.Object
   ↳ com.atlassian.jira.event.AbstractEvent
     ↳ com.atlassian.jira.event.issue.IssueEvent

@PublicApi

This class is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Basic representation of something that happens to an Issue, such as a modification or comment. Event listeners register to receive these.

The IssueEvent object thrown as a result of an edit operation, may now return null from a getChangeLog() call. This can occur when a user chooses to edit an issue but only leaves a comment and makes no other changes to the issue.

Prior to 3.5.2 no event was fired in this case and this was identified as a bug (JRA-9415) and has since been fixed. Check any calls to getChangeLog() for null.

Summary

Constants
String SEND_MAIL
Fields
public static final String BASE_URL_PARAM_NAME Key of event parameter holding the application's base URL.
public static final String CHANGE_HISTORY_PARAM_NAME In case of issue delete events, a param with this key will store list of this issue's change history as a list of ChangeHistoryItem objects.
public static final String COMMENTS_PARAM_NAME In case of issue delete events, a param with this key will store list of this issue's comments as a list of Comment objects.
public static final String CUSTOM_FIELDS_PARAM_NAME

In case of issue delete events, a param with this key may store the custom field values of the deleted issue.

public static final String WATCHERS_PARAM_NAME

In case of issue delete events, a param with this key may store list of this issue's watchers as a list of User objects.

[Expand]
Inherited Fields
From class com.atlassian.jira.event.AbstractEvent
Public Constructors
IssueEvent(Issue issue, Map params, ApplicationUser user, Long eventTypeId)
Create a new IssueEvent with a given list of parameters.
IssueEvent(Issue issue, Map params, ApplicationUser user, Long eventTypeId, boolean sendMail)
Allows configuration of whether the mail notification should be sent
IssueEvent(Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId)
Create a new IssueEvent with a given list of parameters.
IssueEvent(Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId, boolean sendMail)
Create a new IssueEvent with a given list of parameters.
IssueEvent(Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId, boolean sendMail, boolean subtasksUpdated)
Public Methods
boolean equals(Object o)
Note: this will not compare the time stamps of two events - only everything else.
GenericValue getChangeLog()
Comment getComment()
Long getEventTypeId()
Issue getIssue()
Project getProject()
ApplicationUser getUser()
Returns the user who initiated this event.
Worklog getWorklog()
int hashCode()
@Internal boolean isRedundant()
If true, indicates that this issue event can be ignored by listeners, and that some other issue event representing the same thing has been published.
boolean isSendMail()
boolean isSubtasksUpdated()
void setWorklog(Worklog worklog)
String toString()
[Expand]
Inherited Methods
From class com.atlassian.jira.event.AbstractEvent
From class java.lang.Object
From interface com.atlassian.jira.event.JiraEvent
From interface com.atlassian.jira.event.issue.IssueRelatedEvent

Constants

public static final String SEND_MAIL

Constant Value: "sendMail"

Fields

public static final String BASE_URL_PARAM_NAME

Key of event parameter holding the application's base URL.

public static final String CHANGE_HISTORY_PARAM_NAME

In case of issue delete events, a param with this key will store list of this issue's change history as a list of ChangeHistoryItem objects.

public static final String COMMENTS_PARAM_NAME

In case of issue delete events, a param with this key will store list of this issue's comments as a list of Comment objects.

public static final String CUSTOM_FIELDS_PARAM_NAME

In case of issue delete events, a param with this key may store the custom field values of the deleted issue.

NOTE: this parameter is not guaranteed to exist so explicit check in the event parameters map must be performed by the clients. If not found, the custom field values may be retrieved by means of field manager from the issue object associated with the event.

public static final String WATCHERS_PARAM_NAME

In case of issue delete events, a param with this key may store list of this issue's watchers as a list of User objects.

NOTE: this parameter is not guaranteed to exist so explicit check in the event parameters map must be performed by the clients. If not found, the value may be retrieved via getWatchers(com.atlassian.jira.issue.Issue).

Public Constructors

public IssueEvent (Issue issue, Map params, ApplicationUser user, Long eventTypeId)

Create a new IssueEvent with a given list of parameters.

Parameters
issue the issue this event refers to
params parameters that can be retrieved by the Listener
user the user who has initiated this event
eventTypeId the type ID of this event

public IssueEvent (Issue issue, Map params, ApplicationUser user, Long eventTypeId, boolean sendMail)

Allows configuration of whether the mail notification should be sent

Parameters
issue the issue this event refers to
params parameters that can be retrieved by the Listener
user the user who has initiated this event
eventTypeId the type ID of this event
sendMail configure whether mail notifications should be sent

public IssueEvent (Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId)

Create a new IssueEvent with a given list of parameters.

This event also has an attached changeGroup, comment and worklog (any of which may be null).

Parameters
issue The issue this event refers to
user the user who has initiated this event
comment A comment for this event
worklog A worklog for this event
changeGroup An attached changeGroup for this event
params Parameters that can be retrieved by the Listener
eventTypeId the type ID of this event

public IssueEvent (Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId, boolean sendMail)

Create a new IssueEvent with a given list of parameters.

This event also has an attached changeGroup, comment and worklog (any of which may be null).

Parameters
issue the issue this event refers to
user the user who has initiated this event
comment comment for this event
worklog A worklog for this event
changeGroup an attached changeGroup for this event
params parameters that can be retrieved by the Listener
eventTypeId the type ID of this event
sendMail configure whether mail notifications should be sent

public IssueEvent (Issue issue, ApplicationUser user, Comment comment, Worklog worklog, GenericValue changeGroup, Map params, Long eventTypeId, boolean sendMail, boolean subtasksUpdated)

Public Methods

public boolean equals (Object o)

Note: this will not compare the time stamps of two events - only everything else.

public GenericValue getChangeLog ()

public Comment getComment ()

public Long getEventTypeId ()

public Issue getIssue ()

public Project getProject ()

public ApplicationUser getUser ()

Returns the user who initiated this event.

Returns
  • the user who initiated this event.

public Worklog getWorklog ()

public int hashCode ()

@Internal public boolean isRedundant ()

@Internal

This method is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

If true, indicates that this issue event can be ignored by listeners, and that some other issue event representing the same thing has been published.

Returns
  • a boolean indicating whether this event is redundant.

public boolean isSendMail ()

public boolean isSubtasksUpdated ()

public void setWorklog (Worklog worklog)

public String toString ()