Populate RITM variable values through inbound action

Renu9
Tera Contributor

Hi All,

I am triggering a service request through inbound email action.

Where in I need to populate values in RITM variables with the content in email body.

I am using below script, but it is not working. Kindly suggest me any modifcations.

var ritmRec = new GlideRecord("sc_req_item");
ritmRec.addQuery("request", rc.sys_id);
ritmRec.query();
if (ritmRec.next()) {
ritmRec.short_description = email.subject.toString();
ritmRec.description = email.body_text.toString();
ritmRec.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.employee_no = email.body.employee_number.toString();
current.employee_name=email.body.employee_name.toString();
ritmRec.update();

employee_no and employee_name are not populating. Sending email as below.

Employee Number:12345

Employee Name:Test

And also noticed REQ's are not generating in order.

REQ0017421,REQ0017423,REQ0017425

One number is getting skipped. Kindly suggest what is missing here

9 REPLIES 9

Community Alums
Not applicable

HI @Renu ,

Refer the below links may helpful to you.

How to launch Catalog Items from Email

Create Request from Inbound Email Action

Submit a catalog item through Email inbound action

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep,

My request number skipping issue resolved after enabling preventing numbering gaps property.

Is this issue occurs only when we use inbound email actions? 

eumak
Tera Guru

Hello Renu,

value pairs in the message body of a recieved email. You should be able to pull the value using something like:

current.variables.<variable_name> = email.body.information_from_email;


Please update the bold lines with the below code & try

current.variables.employee_no = email.body.employee_number.toString();
current.variables.employee_name=email.body.employee_name.toString();

Mark it as helpful or correct, If Applicable

Cheers..!
Happy Learning:)
Tushar

Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

Renu9
Tera Contributor

Hi Tushar,

Now I can get variables filled up with data from email body. But request numbers are not generating in order, alternate request numbers are getting generated.How to chck this