How to create an incident using inbound email actions?

hema sundar
Tera Contributor

we have a requirement is that when a user sends an email to the servicenow with subject contains incident
then there should be created an incident with the short description
copied from the subject and description copied from the body ? How to achieve this using script?

1 ACCEPTED SOLUTION

Manmohan K
Tera Sage

Hi @Nayan Dhamane ,

 

Create an inbound action similar to below image

ManmohanK_0-1683811892106.png

 

Add below code in Actions tab of inbound action

 

current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.short_description = email.body;

if (current.canCreate())
    current.insert();

 

 

Mark this answer as helpful and correct if this helps resolves the issue

View solution in original post

3 REPLIES 3

Nayan  Dhamane
Kilo Sage
Kilo Sage

Hello @hema sundar ,

Please use the below article as reference for step by step creation of incident using Inbound:
Incident creation via E-mail (Inbound Action)


If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Hello @hema sundar ,

I am glad that my answer was helpful.Please mark it as solution accepted as it will close the thread.

 

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Manmohan K
Tera Sage

Hi @Nayan Dhamane ,

 

Create an inbound action similar to below image

ManmohanK_0-1683811892106.png

 

Add below code in Actions tab of inbound action

 

current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.short_description = email.body;

if (current.canCreate())
    current.insert();

 

 

Mark this answer as helpful and correct if this helps resolves the issue