How to copy HTML content from email body to "description" of incident form? inbound action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 06:52 AM
Hi all,
How to copy HTML content from email body to "description" of incident form?
we have following fields in the email body -:
Start date
Application environment
Error description
Application version
Sender Code.
and now they want the start date, Application version & Application environment in the description field of incident. How can I achieve this .
Thanks,
|
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 07:05 AM
Hi vibha
What did you try so far?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 07:47 AM - edited 10-13-2022 07:48 AM
Hey Rohila,
I have created the following script for getting one variable value, now I am stuck to get the value from other HTML.
var messageBody = email.body_text;
var startIndex = messageBody.indexOf('Application environment') + 20; // the size of this string;
var endIndex = messageBody.indexOf('Error description ', startIndex);
var myString = messageBody.substring(startIndex, endIndex);
//now remove any white space
myString = myString.trim();
current.description=myString;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 12:39 AM
Hi Vibha
Can you share the email format?
Are they coming in the format you mentioned above or is it like
Start date : <<some value>>
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 07:25 AM
Hello,
Are they always coming in this format and is it like Start date : some value? i.e varibale value format? I ye syou can us the below
current.description=email.body.Start date+ email.body.Application environment+ email.body.Application environment.Application version
For more information please check the below article:-
Please mark my answer as correct based on Impact.