Service Cloud: Report on and Email the Last Case Comment
One of my favorite items to implement when doing a Service Cloud Implementation is something I refer to as “Last Case Comment.”
For those of you who are unfamiliar with Case Comments, they are a tool for external and internal communication on Cases. They do not require a Service Cloud license, they do not require any feature license. With some configuration, they can be used to send emails to your Customer Portal (now Community) users as well as to drop a note to the Case Owner to take a look at a new update from the Engineering team.
I add a few custom fields and a workflow rule to do the following:
- Copy a Case Comment Body into a hidden text field on the Case
- Do the same for the Date/Time the User created the Case Comment
- Also to stamp the User who left the Comment.
This allows you to now do the following:
- Send email alerts to a Case Team when a new Case Comment is added to a Case
- Send email alerts on any Case Comment, Public or Private
- Report on just the Last Case Comment, Public or Private
The reason behind doing these customizations is because of the following limitations:
Reporting
Salesforce allows reports on either “All Case Comments,” or “The Most Recent Public Case Comment.” I often see that Customer Service Managers and Reps have wanted visibility into the most recent Public or Private Comment and not have some endless list of all the comments ever entered on that Case.
Email Alerts
Salesforce allows you to use the merge field — {!Case.Last_Case_Comment} — however this only pulls in the “Most Recent Public Case Comment.” So, in order to be able to send an email alert with the Last Case Comment (Public or Private), you need to create a new field and populate it with this data.
In order to implement this, follow the steps below:
- Create three custom fields on the Case object:
- Last Case Comment Date/Time (Date/Time)
- Last Case Comment (Long Text Area)
- Last Case Comment User (Text)
- Create a Workflow Rule on Case Comment with the following attributes
- Criteria: ISNEW()
- Field Update: Last Case Comment Date/Time with the Created Date/Time from the Comment (CommentDate)
- Field Update: Last Case Comment with the Body from the Comment (CommentBody)
- Field Update: Last Case Comment User: This one is trickier, use the following formula: $User.FirstName &” “& $User.LastName
Note: There are some caveats with the $User fields. See this blog article for more information.
Happy Case Commenting!