Populate RITM variable values through inbound action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 04:23 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 06:26 AM
Happy to know that you are able to get the variable's details. In my view your code is correct.
Cheers..!

Happy Learning:)

Tushar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 07:11 AM
Hello Renu,
Happy to know that you are able to get the variable's details. In my view your code is correct.
From my past worked scenario on these types of req's , It is not necessary that you will be getting the continuous REQ or RITM Number, because those REQ & RITMs are generated by the system.
Mark it as helpful or correct, If Applicable
Cheers..!
Happy Learning:)
Tushar
Cheers..!

Happy Learning:)

Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2022 01:21 AM
Hi Tushar,
Could you please help me know how to keep data in Date field in variables through inbound action.
Ex: 01/04/2022
current.variables.start_date=email.body.start_date; is not giving proper date in the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2022 01:54 AM
Hello Renu, Can you please share what date you are getting & what you are entering in the email?
Also can you please check in your instance what is the format for date? After checking once try to write the date in the email as your profile time format.
You can find like Go to Profile -> check what is the format for date.
Trt to go through below link as well which explains how to parse date in the required format.
https://community.servicenow.com/community?id=community_question&sys_id=bf9f0365dbdcdbc01dcaf3231f96190f
Cheers..!
Tushar
Cheers..!

Happy Learning:)

Tushar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 05:02 AM
Hello Renu,
Dis it help you to get the correct dates?
Cheers..!
Tushar
Cheers..!

Happy Learning:)

Tushar