Service Cloud: Report on and Email the Last Case Comment

Call CenterOne 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:

  1. Copy a Case Comment Body into a hidden text field on the Case
  2. Do the same for the Date/Time the User created the Case Comment
  3. Also to stamp the User who left the Comment.

This allows you to now do the following:

  1. Send email alerts to a Case Team when a new Case Comment is added to a Case
  2. Send email alerts on any Case Comment, Public or Private
  3. 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:

  1. Create three custom fields on the Case object:
    1. Last Case Comment Date/Time (Date/Time)
    2. Last Case Comment (Long Text Area)
    3. Last Case Comment User (Text)
  2. Create a Workflow Rule on Case Comment with the following attributes
    1. Criteria: ISNEW()
    2. Field Update: Last Case Comment Date/Time with the Created Date/Time from the Comment (CommentDate)
    3. Field Update: Last Case Comment with the Body from the Comment (CommentBody)
    4. Field Update: Last Case Comment User: This one is trickier, use the following formula: $User.FirstName &” “& $User.LastName

Add Comment to Case

Note: There are some caveats with the $User fields. See this blog article for more information.

Happy Case Commenting!