Move email to newly transferred Case

preethigovi
Tera Contributor

Hi Team,

When HR case is moved to different COE and existing HR case is cancelled, when user sends email to existing HR case that is cancelled, copy that email to newly transferred case.

 

How to achieve this?

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @preethigovi ,

After transferring the case with existing case number, when an inbound email action is triggered the email is copied as comments to the new case created with same number. Customer has to enable Additional Comments(Customer visible) from the Activity filter to see the inbound email as the comment for the new case.

 

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

Hi @preethigovi ,

After transferring the case with existing case number, when an inbound email action is triggered the email is copied as comments to the new case created with same number. Customer has to enable Additional Comments(Customer visible) from the Activity filter to see the inbound email as the comment for the new case.

 

Shivalika
Mega Sage

Hello @preethigovi 

 

You just need to add conditions to check the state field of the HR case and if its cancelled, there would be another case which might be stored in that field you can redirect there. 

 

Can you show your existing inbound action ? Also the fields if you could specify exactly based on solution I suggested, I could help your thoroughly. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

preethigovi
Tera Contributor

Yes, its copied as comment to transferred case, and if multiple transfer happens, it should add comment to last transferred case. So i used the SI to get last transferred case sys_id and call in inbound action.

 

getTransferredCase: function(firstCaseID) {

        var currentSysId = firstCaseID;
        var finalCaseSysId = currentSysId;
        while (currentSysId) {
            var caseRecord = new GlideRecord('sn_hr_core_case');
            caseRecord.addQuery('sys_id', currentSysId);
            caseRecord.query();
            if (caseRecord.next()) {
                if (gs.nil(caseRecord.transferred_to)) {
                    finalCaseSysId = currentSysId;
                    break;
                }
                currentSysId = caseRecord.transferred_to.toString();
            }
        }
        return finalCaseSysId