Extract text from inbound email and post to description field on target record

John Prahn
Kilo Contributor

Hi All, 

I have a requirement to extract data from an inbound email and post to the short description field on the target record. 

We have an integration setup using notifications and when the record is initiated on the other system, it will respond in email with that ticket number. 

I have attached a sample of the inbound email. I am looking to extract the line: Ticket #xxxxxxxx. 

 

Thanks in advance!

30 REPLIES 30

I tried the code just as posted and no luck. It didn't update the short description at all. 

Should this code alter? 

var ticket = email.subject;
ticket = subject.split("/");
gs.log(ticket[0]);
var sub = current.short_description;
current.short_description = sub + " - " + ticket;
current.update();

yes.

you need to use like this

var ticket = email.subject;
ticket = subject.split("/");
gs.log(ticket[0]);
var sub = current.short_description;
current.short_description = sub + " - " + ticket[0];
current.update();

Mark the comment as a correct answer and helpful once worked.

Hi John,

Let me know if it has worked?

Hi John,

If my given solution has worked for you, kindly mark the comment as a correct answer and also helpful.