Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to create service request through Inbound action ?

hemanth16
Tera Contributor

I have a requirment when ever I receive an email from outside automatically it should create service request 

I have a catalog item - onboard 

find_real_file.png

Based on the email body how to can I write script to fill this fields and submit this request ?

 

Thanks in Advance!!

2 REPLIES 2

Subhankar Pram2
Tera Contributor

have u tried using the cart API:

 

the code should look something like this:

var v_cartId = GlideGuid.generate(null);
var v_cart = new Cart(cartId);
var item = v_cart .addItem('<sysid_of_catalog_item>');
v_cart .setVariable(item, 'new_hire_name',email.body_text.name);
v_cart .setVariable(item, 'email', email.body_text.mail);
.
.

.

.
var v_Submit = v_cart .placeOrder();

ersureshbe
Giga Sage
Giga Sage

Hi,

As per the OOB functionality - incident will be created with out reference as prefix via email.

If you take Case ticket creation, You should use 'Case:' as prefix to create the ticket via email.

Similar way , you should use some prefix to create the service request and you can update the RITM via email as per OOB functionality.

Regards,

Suresh. 

Regards,
Suresh.