Hello All,
Could you please help me with the following question:
We are using the email service TicketsFromEmail with the Apex class MailListen_IncidentCTHandler to automatically create incidents in Remedy from incoming emails.
Recently, the Apex class was updated in the Sandbox environment by adding the following line:
incident.Title__c = email1.Subject;
This change is intended to populate the Title field of the newly created incident using the subject line of the email that triggered its creation.
However, when I send emails with the template name in the subject line (e.g., EQNH New Hire - Test Test_06/23/2025) to create an incident using that template, the Title field in the incident includes the entire subject line, including the template name (e.g., "EQNH").
Could you please help me understand how I can update the Apex class—or specifically the newly added line
incident.Title__c = email1.Subject; —so that the template name (e.g. EQNH) is excluded from the Title field of the created incident?
Thank you in advance!
Eric Burté (DEVOTEAM) Forum Ambassador
@Serge Shelkoshvein I guess that your email1.subject has the prefix at the beginning, as you are trying to get the template prefix on line 45 (where you get the 4 left char from the subject to the Templ variable).
If you do have indeed a template name, at the beginning of the email subject, indeed please get the whole text, except the 4 first characters
Eric