How to get Case details from CaseComment object in trigger?

How to get Case details from CaseComment object in trigger?

Sample Code:


Set < Id > caseCommIds = new Set < Id >();
        Decimal TotalTime = 0;
   
    for ( CaseComment cas : trigger.new ) {
    caseCommIds.add(cas.Id);
    }
   
    List < CaseComment > listCaseComments = [ SELECT Id, Parent.CaseNumber, Parent.Description FROM CaseComment WHERE Id IN: caseCommIds ];
   
        for ( CaseComment cas : listCaseComments ) {
       
        }

Leave a Reply