Last active
August 29, 2015 14:13
-
-
Save jechlin/2824046dd7a4ada6bc3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples.answers | |
import com.atlassian.jira.event.issue.AbstractIssueEventListener | |
import com.atlassian.jira.event.issue.IssueEvent | |
import com.atlassian.jira.event.issue.IssueEventDispatcher | |
import com.atlassian.jira.event.type.EventType | |
import groovy.util.logging.Log4j | |
import org.apache.log4j.Level | |
@Log4j | |
public class FireACommentOnResolve extends AbstractIssueEventListener{ | |
@Override | |
void workflowEvent(IssueEvent event) { | |
log.setLevel(Level.DEBUG) | |
if (event.eventTypeId == EventType.ISSUE_GENERICEVENT_ID && event.getComment()) { | |
def issue = event.issue | |
IssueEventDispatcher.dispatchEvent(EventType.ISSUE_COMMENTED_ID as Long, issue, event.getUser(), event.getComment(), null, null); | |
} | |
if (event.eventTypeId == EventType.ISSUE_COMMENTED_ID && event.getComment()) { | |
log.debug("comment event fired with comment: ${event.getComment()}") | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment