Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

JEMH provides the ability to control the events that its Event Listener detects. Events can be ignored, replaced or added to in addition. This config happens at the Project Mapping level, so no per-template changes are needed. If per-event changes are required, the templates must be updated, see:

Approach

The Event Listener Project Mappings have a Velocity script field which allows logic to be coded that could drive a change in how the event is handled.

...

Script being edited in Event Listener

Script being viewed in Event Listener

Image RemovedImage Added

Image RemovedImage Added

The result of a comment on an issue with 'Lowest' priority' can be seen, First the NON-JIRA User Notifier runs, showing the velocity pos-processing of the non-JIRA script (which here was just static text and didn't affect the $result:  "Non JIRA script here".

...

Code Block
2015-12-17 15:10:49,274 http-nio-8080-exec-22 INFO [emh.service.listener.JEMHIssueEventListener] Running notification handler: JIRA User Notifier
2015-12-17 15:10:49,277 http-nio-8080-exec-22 DEBUG [jira.emh.service.DefaultJEMHMessageManager] EventSelectorScript result - issue: TEST-129 and event: 6, Result: ignoreEvent: true, eventOut: 0, reason: Its a trivial issue, velocity debug output:
----------------
Running script
Trivial Issue
 
 
----------------
2015-12-17 15:10:49,277 http-nio-8080-exec-22 DEBUG [emh.service.listener.JiraUserNotifier] JiraEventSelectorScript ignored eventID [6], reason: Its a trivial issue

Blocking all

...

JSM Internal Comment notifications

Code Block
#if ($comment)
comment present

#if ($jemhUtils.isPrivateJSDComment($comment.getAuthorApplicationUser(), $comment))
Comment is INTERNAL
$result.setIgnoreEvent(true)
$result.setReason("JSM internal comment detected, blocking ALL")
#else
Comment is PUBLIC
#end 

#else
no comment present
#end

...