This post-function/listener allows you to send a personalized custom message to either your HipChat or your Slack room.

There are bindings for the issue and the event object so that you can fetch the information pertinent to your event.

For example - you can choose to listen to Issue Resolved Event and have a message that outputs the resolution and the user that resolved the issue.

"Issue $issue resolved with resolution <% out << issue.resolution?.name %>. by <% out << event.getUser() %>"
CODE

Configuration

In this case, the configuration is slightly more complicated. You need a Slack app with an access token.

String templating in groovy

There are two variables available for you to use in your template, "issue" and "event". This last one is only available if you configure this feature as a listener.

Check the documentation about constructing your string template for the last field of the form:

As a summary, in order to call a property, you can call it with the name


"Your issue $issue has been updated."

But you can do more complex calls to your object by using the<% %> notation:

"Your Issue $issue was updated by <% out << event.getUser() %> on <% out << event.getTime() %>."
CODE