The Need: When a specific custom field is changed ("assignedTeam"), an email is sent to all members of the group listed in a group custom field (single select).
My Method:
- Wrote a custom listener in Scriptrunner that listens for Issue Updated. If that script detects a change in assignedTeam, then the script creates a new eventBundle and dispatches it as a custom Event with an ID of 10300 (code excerpt below).
- My notification scheme catches that custom Event and sends a notification to various users.
The Problem:
- Almost everything works perfectly. The script catches the change in assignedTeam, fires the event, the notification scheme catches the event, creates the email, and sends it to all the right people.
- BUT the email does not show which fields were changed and the old/new values:

- In contrast, this is what a "normal" update notification looks like and what I want mine to look like:

I think my mistake is in the construction of the issueEvent/eventBundle (below). I think there should be some way to pass the change log to the constructor, but I just can't figure it out. Thanks.
Listener code:
if assignedTeam has changed...
{
Long EVENT_ID = new Long("10300")
IssueEventManager issueEventM = ComponentAccessor.getIssueEventManager()
IssueEventBundleFactory issueEventFactory = (IssueEventBundleFactory) ComponentAccessor.getComponent(IssueEventBundleFactory.class)
IssueEventBundle eventBundle = issueEventFactory.wrapInBundle(new IssueEvent (issue, null, event.user, EVENT_ID, true))
issueEventM.dispatchEvent(eventBundle)
}