Email Received field on Incident form

cdavis22
Tera Contributor

Good Morning,

 

I am reaching out for help with the code below. I have been asked to create a custom field on the Incident form that changes to "update received" when incident receives an email. The field is automatically on update clear & when someone replies to the incident notification it should change to "Update Received". My Business rule below is not automatically updating the form. Please see code & BR, also the the field did not update with or without the filter condition so I am assuming it is the code. 

 

Custom field:

 

 

 

 

// Check if the update came from an email
if (current.source == "email" || current.source == "Inbound email") {

// Set the value of the Update Status field to "Update received"
current.u_email_update = "Update received";
}

})(current, previous);