0

We are usinng Email-To-Case features and periodically, when clients do not answer to the thread, we close the cases.

It happened few times that the client answered later and we missed the client reaction, because the case was already closed. We tried to create a process with process builder on case comment, but we could not find a relation with the case record so to update the state.

How can we re-open the case?

3 Answers 3

1

You can create a process as shown below:

enter image description here

0

You can write custom trigger on Case Comment object and you will get case Id in ParentId field of Case comment.

0

Below is one such trigger (cleaned). Better if you create a flow instead like Himanshu shared above.

/* Trigger on CaseComment to reopen a Case when a new comment is added */ trigger CaseCommentTrigger on CaseComment (after insert) { /* List to hold Cases that need to be updated */ List<Case> casesToUpdate = new List<Case>(); for (CaseComment comment : Trigger.new) { if (comment.ParentId != null) { /* Query the Case related to the CaseComment. Bulkify this. Only for DEMO. Remove LIMIT */ Case relatedCase = [ SELECT Id, Status, msid__c FROM Case WHERE Id = :comment.ParentId and msid__c = 'xyz' LIMIT 1 ]; /* Check if the case is closed and add it to the update list */ if (relatedCase != null && relatedCase.Status == 'Closed') { relatedCase.Status = 'Open'; casesToUpdate.add(relatedCase); } } } /* Update Cases */ if (!casesToUpdate.isEmpty()) { update casesToUpdate; } 

}

Hope it helps.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.