I have created a trigger and it works without @mention. But I need the owner name of the case on the body of the chatter post.
trigger CasePostFeed on Case (after insert) { system.debug('POST STARTED'); List <Case> caselistToUpdate = new List<Case>(); for(Case ca: trigger.new) { FeedItem FI = new FeedItem(); system.debug('CASE ID CREATED 1 '+ ca.Id); if(ca.Status == 'New'&& ca.RecordTypeId == '0120M000000ATBC') { system.debug('CASE ID CREATED 2 '+ ca.Id); FI.CreatedById ='00530000007mCQD'; FI.ParentId = ca.Id; FI.Body = 'HI @'+ca.Owner_Name__c+'\n'+'\n'+ ca.Subject +'\n'+ ca.Contact_Name_for_Chatter__c +' from '+ca.Account_Name_for_Chatter__c +' has submitted a new case.'+'\n'+'You can find the Case on your Trainee Management dashboard or you can get to it from this post.'; system.debug('POST CREATED'); insert FI; } }