Skip navigation
Share This:

Some Background Info:

 

Our company wanted to notify via email the incident assigned staff (Incident: Staff) whenever someone else added action history (eg, added note, sent email, email received, etc). This is to help keep the assigned staff aware that updates have been received or new notes added without the technician actively monitoring the incident console.

 

Since we use both Queue and Staff assignments on our Incidents, the steps outlined here Notify technician when incident is updated via email did not work out of the box. However, if you only support single assignment on Incidents, those steps should work. The reason is because with Queue and Staff assignments enabled, the Incident Owner field always references the Queue. This is important to note when you're trying to wire up the Workflow Email Alerts.

 

The dilemma is that on the Incident History object, the Staff field is not the same as the parent Incident: Staff field but rather is the logged-in user who added the note/action history record. I have no clue why. This confused me for a long time and caused a lot of troubleshooting headache. Secondly, when creating the Email Alert on the Incident History object, there is no option to choose the Staff field from the parent Incident. So you're stuck with either sending the email to the queue (Incident: Incident Owner) or sending the email back to the person who added the note (Incident History: Staff ID). Neither of these were acceptable, so I had to keep digging.

 

My workaround was to introduce two (2) new custom fields on the Incident History object. One is an Email type field that a workflow field update will copy the parent Incident Staff's email address into. The other is a Checkbox type field that workflow field updates will toggle on/off.

 

 

What we'll be doing in this setup:

 

  1. Create two (2) custom fields on Incident History object as mentioned above
  2. Create one (1) email template
  3. Create one (1) workflow email alert
  4. Create three (3) workflow field updates
  5. Create two (2) workflow rules

 

 

Step 1 - Create Custom Fields

 

Notify Staff Comment Added Controller
custom_controller_field.PNG.png

Object: Incident History

Field Label: Notify Staff Comment Added Controller

Data Type: Checkbox

Default Value: Unchecked

 

Incident Assigned Staff Email

custom_email_field.PNG.png

Object: Incident History

Field Label: Incident Assigned Staff Email

Data Type: Email (must be email type so can choose it in email alert we create later)

Default Value: Blank

 

 

Step 2 - Create Email Template

 

Nothing fancy here. Just create a new email template that uses merge fields from the Incident History object. The email alert we create in the next step will reference this email template.

 

 

Step 3 - Create Workflow Email Alert

 

email alert.PNG.png

Object: Incident History

Description: custom_notify_staff_incident_comment_added

Email Template: The template you created in step 3

Recipient: Email Field: Incident Assigned Staff Email (custom field created in step 1)

 

 

Step 4 - Create Workflow Field Updates

 

Set Notify Staff Comment Added Controller
set controller field update.PNG.png

Object: Incident History

Field to Update: Incident History: Notify Staff Comment Added Controller

Field Data Type: Checkbox

Re-evaluate Workflow Rules: Checked (Very important! When a new incident history record is created, we need one workflow rule to run and copy email address into our custom field THEN have workflows run again so that the second workflow can use the email in its email alert. This has to be the order of operations to enforce the email field is copied over before the email alert fires. If you try to use one workflow rule that has a field update to copy the email address and uses the email alert then you leave it up to chance whether the email alert will fire before the email address is ever copied over.)

New Field Value: True

 

Clear Notify Staff Comment Added Controller
clear controller field update.PNG.png

Object: Incident History

Field to Update: Incident History: Notify Staff Comment Added Controller

Field Data Type: Checkbox

Re-evaluate Workflow Rules: Unchecked

New Field Value: False

 

Set Incident Assigned Staff Email
set inc hist email field update.PNG.png

Object: Incident History

Field to Update: Incident History: Incident Assigned Staff Email

Field Data Type: Email

Re-evaluate Workflow Rules: Unchecked

New Field Value: BMCServiceDesk__FKIncident__r.BMCServiceDesk__FKOpenBy__r.Email

 

 

Step 5 - Create Workflow Rules

 

Set Notify Staff Comment Added Controller
workflow set values.PNG.png

Object: Incident History

Name: Set Notify Staff Comment Added Controller

Evaluation Criteria: When a record is created

Rule Criteria: Only runs if staff is assigned to incident -AND- the person creating the incident history record is not the same person

AND(

  NOT( ISBLANK( BMCServiceDesk__FKIncident__r.BMCServiceDesk__FKOpenBy__c ) ),

  BMCServiceDesk__FKIncident__r.BMCServiceDesk__FKOpenBy__c <> BMCServiceDesk__FKUser__c

)

Workflow Actions:

   1. Field Update to set incident assigned staff email (this copies the email address over to be used by email alert in 2nd workflow)

   2. Field update to toggle on the controller field that tells the 2nd workflow it should run

 

Custom Notify Staff Incident Comment Added
workflow email alert.PNG.png

Object: Incident History

Name: Custom Notify Staff Incident Comment Added

Evaluation Criteria: When a record is created, and every time it's edited

Rule Criteria: Incident History: Notify Staff Comment Added ControllerEQUALSTrue

Workflow Actions:

   1. Email alert to the custom email field whose value is set in the first workflow

   2. Field update to toggle off the controller field so this workflow doesn't fire again until a new incident history record is created