Inbound Email Action to open REQ/RITM/Task and populate Variables - Possible?

Wendy Peterson
Giga Guru

We have a group that goes through somewhere called Condeco - They want this company to send an email to our site and have Service Now somehow parse out and complete a Service Request which then sends a task to our Building Office Service Group. I've never heard of such a thing. I know an inbound email can be used to like populate a table or an incident but never a relationship like the Variables and Requests. Anyone know anything about this and if it's possible and how much work would it be if possible? TIA

 

 

1 ACCEPTED SOLUTION

Hi,

Variables can be read from template:

 

i.e:

Email Body should like below:

 

Event Name: ABC

Building Location: YYZ

 

While reading email by inbound action use:

email.body.event_name

email.body.building_location

 

space between works are replaced with underscore.

If the template is in HTML you can read email.body_html and parse using regular expression.

 

 

Thanks

 

View solution in original post

8 REPLIES 8

Upender Kumar
Mega Sage

Hi,

You can create RITM /REQ/TASK:

 

find_real_file.png

Below is script to add in script section

var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);

//sys_id of catalog item
var item = cart.addItem('f17b8e7f6f472100de7ee1b3dd3ee4fc');
//gs.getProperty('com.swo.catalog.globalacademic'));
cart.setVariable(item, 'u_sub_service',sub_service);
cart.setVariable(item, 'u_block_unblock_reason', 'Requested through Nav');

//Set value of all variables

var rc = cart.placeOrder();
var gr = new GlideRecord("sc_req_item");

 

// Stop to process next inbound actions

event.state="stop_processing";

// Workaround to set target to REQ
sys_email.instance = rc.sys_id;
sys_email.target_table = rc.getTableName();
sys_email.update();

I would have never thought this is possible. What type of script is that? or where do you put it. So you can Hardcode items on the cart.setVariable? or does it some how parse out their email. So there body of the email would be like probably the "description" in their request? TIA

So like here is the request they want to fill out by the email templates. How would their email update these fields? I get the hardcoding just not how the email works to decipher fields

 

find_real_file.png

Hi,

Variables can be read from template:

 

i.e:

Email Body should like below:

 

Event Name: ABC

Building Location: YYZ

 

While reading email by inbound action use:

email.body.event_name

email.body.building_location

 

space between works are replaced with underscore.

If the template is in HTML you can read email.body_html and parse using regular expression.

 

 

Thanks