Generate a change request through Inbound email action

abhishekmittal
Tera Contributor

Hi,

We have an inbound email action which creates incident but whenever we have "xyz" in the subject line, we need to generate a change request instead of incident.

How can we achieve this please help me to find the solution?

Regards,

Abhishek

12 REPLIES 12

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Abhishek,



Yes, you can create an Incident and Change Request in a single Inbound Action. In fact, you may create as many records you want. Please find the below example, where I am creating a Change Request in the 'Create Incident' Inbound Action.



find_real_file.png




if(email.subject && email.subject.indexOf('xyz') != -1){


var change = new GlideRecord('change_request');


change.short_description = email.subject;


change.insert();


}



2nd Option   - You may also create another Inbound Action on 'Change' table to handle this. But the above option will make it easy if you need to refer the change or incident reference in each other.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


Thanks a lot Antin and everyone who has responded with their valuable response.



Thanks and Regards,


Abhishek


antin_s
ServiceNow Employee
ServiceNow Employee

Hi Abhishek,



If my reply has answered you question, can you please mark it as 'Correct' to help the community?



Thanks


Antin