Update case status when outbound email is sent

gourabhishe
Tera Contributor

Hello,

 

I have a requirement in CSM.

 

When the case state is 'Awaiting Info' and an outbound email is triggered from the workspace by the agent then the state should automatically update to 'Open'.

 

Any suggestions how can this be implemented?

2 REPLIES 2

vaishali231
Kilo Sage

Hey @gourabhishe 
You can implement this by monitoring outbound emails created from the Case workspace.

A common approach is to create an After Insert Business Rule on the sys_email table and check:

     target_table = sn_customerservice_case

    email type = send-ready or sent

Then retrieve the related Case using current.instance and update the state from Awaiting Info to Open.

Table

sys_email

When

After Insert

Condition

current.type == 'send-ready' || current.type == 'sent'

Script

(function executeRule(current, previous) {
    if (current.target_table != 'sn_customerservice_case')
        return;
    var caseGr = new GlideRecord('sn_customerservice_case');
    if (caseGr.get(current.instance)) {
        if (caseGr.state == '<Awaiting Info value>') {
            caseGr.state = '<Open value>';
            caseGr.update();
        }
    }
})(current, previous);

You can also implement the same using Flow Designer with:

  1. Trigger: Record created on sys_email
  2. Conditions for outbound Case email
  3. Update Case state to Open

****************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb





vaishali231
Kilo Sage

hey @gourabhishe 

 

Did my previous reply answer your question?

If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.

 

Thankyou & Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb