Inbound Email Actions - grabbing values across multiple lines

Jamsta1912
Tera Guru

Hello all,

I'm working on a simple email integration between two Service-Now instances. The two instances are sending plain text emails to each other, with 'field : value' pairs. One of the values in emails is populated by the latest work notes entry, and it looks something like this:

Work Note: 2014-12-31 16:08:20 - Jonny Anonymous (Work notes)

I am the content of a work note.


My inbound action is trying to grab the latest work note to add to the description field of the incident in the receiving instance:


myRecord.description = email.body.work_note;


However, I'm finding this only grabs the '2014-12-31 16:08:20 - Jonny Anonymous (Work notes)' part, and ignores the part on the new line 'I am the content of a work note.'

Is this a limitation of using the field : value pairs created by the inbound action? The solution I'm thinking of will use a regex object... which I believe is the way forward?


Any advice, much appreciated as always.


Jamsta

5 REPLIES 5

Hi @evanlw ,

 

Thanks for this thread & solution.

 

I tried this solution however I need to capture few lines of the description mentioned on the email's content.

 

For Example the email content is:-

Category:HRSystem
Sub Category: Error
Configuration Item:Web Services
Assignment Group:Business Services
Short Description:UAT Workspace
Description: "Error
workspace job has failed.
In the uat environment Tested and Failed“

Could anyone take a look for a reason.

Regards,

XXXXXXXX

XXXXX

 

Would like to capture in Incident's description field as this :-

Error
workspace job has failed.
In the uat environment Tested and Failed

 

However current it is coming with :-

"Error
workspace job has failed.
In the uat environment Tested and Failed“

Could anyone take a look for a reason.

Regards,

XXXXXXXX

XXXXX

 

Could you please guide or help me on how to get this?