I’ve been trying, like really stressing, to find a way to take an email sent into my FreshService, pull out details from a consistently formatted body, and populate fields in a ticket with the data.
The email body consists of the following:
Name : JASON TEST
SamAccountName : JTEST
DistinguishedName : CN=JASON TEST,OU=USERS,OU=TEST,DC=contoso,DC=com
SID : S-1-5-21-953425057-2096312333-931750244-25872
Description : CORPORATE - GENERIC
EmployeeID : 79998
employeeType : Salaried
Enabled : True
accountExpires : 1/11/2023 12:00:00 AM
I am trying to
- extract the text after Name: as a string
- extract the number after EmployeeID: as a numeral
- extract the data after accountExpires: as a date
and put each of those extractions into a corresponding service request field.
I was given this expression, which when it sees a hashtag (#req) in the email body finds the email address of the original sender from a forwarded email.
substring( '{{ticket.description}}', indexOf( '{{ticket.description}}','#req',0)+5, indexOf('{{ticket.description}}','.com',indexOf('{{ticket.description}}','#req',0)+5) +4)
and I will be hog tied if I can deconstruct this or make any sense of the “index of comments”
Would anyone be willing to help me figure this mess out?