RocketChat is an open source messaging platform that enables secure team collaboration. It competes with Slack but allows different hosting options, including self-hosting and SaaS cloud hosting.
JEMHCloud supports RocketChat notifications from Issue Events and Post Functions. You will be able to notify your RocketChat Channels when JEMHCloud detects an issue change.
In order to send RocketChat notifications from Issue and Post function events, you need to set up a Personal Access Token RocketChat. JEMHCloud will use that access token to authenticate to your RocketChat service when sending notifications.
RocketChat provides an open instance for anybody to quickly try their services without installing or requiring a trial. The instance is https://open.rocket.chat. We will use the open cloud instance when integrating RocketChat with JEMHCloud and Jira.
To set up your own RocketChat instance, follow RocketChat's documentation.
For this step, we are assuming that you have a RocketChat server already configured. The server can be one you have installed in your infrastructure or one cloud instance RocketChat hosts.
Note: The author of the messages will the user that owns the personal access token. If you want a different more generic name, you would need to create a RocketChat integration user (for example Jira or JEMHC) and create the personal access token using that user. |
If you are using the open RocketChat instance, it's recommended that you create a private channel so the Jira tests messages are not shown to the world!!! To create a private channel,
Create JEMHCloud's RocketChat Notification Mapping
Like Email, Slack and SMS Notification Mapping, RocketChat Notification Mapping is in charge of sending RocketChat messages from Issue events through the RocketChat Connection.
Creating a RocketChat Notification Mapping:
Send RocketChat Notifications from Post Functions
JEMHCloud allows you to send RocketChat notifications when Issue transitions are performed through JIRA Post Functions.
Adding the RocketChat Notification Post Function to workflow transition:
Both RocketChat Notification Mapping and RocketChat Post Function behavior can be changed at runtime with a Velocity Script. The script can use the event data or be time-based to change how notifications are performed.
#if ($context.issue.fields.priority.name.textValue() != 'Critical') $RocketChatNotificationUtils.setRoom('anotherRocketChatRoom') ## JEMHC to send the message to a Rocke.Chat room. It can be the room id or the room name. #end |
#if (!$dateTimeUtils.betweenHours("18:00", "06:00")) $rocketChatNotificationUtils.inhibitNotification() ## RocketChat messages are not sent during business hours ** #end |
#if ($context.issue.fields.priority.name.textValue() != 'Blocker') $rocketChatNotificationUtils.inhibitNotification() #end |
Velocity Script cannot be validated at configuration time (for example the dynamic room). You should test the script by re-executing events in Auditing → Events |
|