To keep your HipChat users in the loop, you can add notifications of Salesforce activities into HipChat room. For example, this is useful to notify users on any changes to Leads or alert your Services team upon arrival of new support tickets.
This guide will help you to prepare the required Apex triggers and configure the activities you can subscribe to. If you haven't done so, configure the available objects and fields before proceeding with the following steps. The Salesforce package must have also been installed and configured.
Early beta testers, please review Notes for Beta Testers.
Part 1: Plan out your activity subscription
The connector provides subscription of three types of activity:
- Object created
- Object updated
- Object created and updated, combined
All of these types can be applied to most standard and custom objects e.g. Lead, Contact, Case, etc.
You will need to configure the remaining parts below depending on the object type and activity type you chose here.
Part 2: Create and deploy Apex triggers
The connector relies on Apex Triggers to be informed of Salesforce activities. These triggers have to be created and deployed manually in Salesforce, but they are pretty simple triggers. For Salesforce Enterprise and Unlimited edition, the standard deployment of Apex triggers are required (see Salesforce documentation).
The following code samples show how to write notification triggers for Cases and the respective test code. To create triggers for other objects, replace the object name in the code accordingly.
Object created and updated, combined
Apex test class for the triggers
Once triggers are created, they need to be tested to allow deployment to Production environment. A sample unit test for the triggers looks as follows:
Remember to replace the object name (API name) in the code accordingly.
If you are testing a Custom Object, provide the fully qualified name (include your namespace in the Salesforce Object Name)
Part 3: Configure notification subscription
Once the Apex triggers are deployed, it's time to tell HipChat to subscribe to the notifications.
- In www.hipchat.com, visit the room's configuration page for the connector.
- Under the Available Salesforce Objects section, toggle the respective buttons for the object to subscribe. For example:
Note that the notification will only be sent when it is turned on, and when the Apex trigger is installed and deployed. A successful configuration will notify the chatroom like this:
- No labels