The CreatorCon Call for Content is officially open! Get started here.

remove the unwanted content in inbound emails

Prerana1
Kilo Guru

Hello Guys,

We have created the inbound actions to create the ticket when OTRS tool send an email to Servicenow but along with the mail the extra content is also updating in the ticket( see the print screen) i want to eliminate the extra content and to keep only the main content, i have written a code but no luck.

Can anyone guide me with this Please?

find_real_file.png

find_real_file.png

Thanks and Regards,

Prerana

1 ACCEPTED SOLUTION

Hello Prenana, I tried with another approach and it worked:


var body = email.body_text;


var expectedTxt= body.split("Bitte denken Sie an")[0] ; // add your line here or keep 4 words

gs.log("expectedTxt: "+expectedTxt);

Thank You!
Abhishek Gardade
ServiceNow MVP 2020

Thank you,
Abhishek Gardade

View solution in original post

13 REPLIES 13

Hello Abhishek,

Thank you for your reply!

I am working in domain seperated instance and i am not sure whether it is recommended to modify the property, i tried to replace the text in the code but no luck, What is your suggestion on this?

Thanks and Regards,

Prerana

I tried same thing on my instance and it worked. can you show me how you did it?

Thank you,
Abhishek Gardade

find_real_file.png

As this is multiline string, i tried to concatenate everyline but still no luck.

Any thoughts on this?

 

Thanks and Regards,

Prerana

We can write a code for removing text after a specific line/keyword. I have worked on similar use case. I will share a code.

Thanks,

Abhishek Gardade

Thank you,
Abhishek Gardade

Thank you!!!

 

Regards,

Prerana