How to update RITM Variable using Inbound Email Action

saikatmitra
Tera Contributor

Hi Team,

My inbound email action is triggering but it is not updating the variable. Can you spot where I am going wrong. Below is the script.

The line "current.variables.more_information_required = info_provided" is not working though comments are getting updated properly.

 
gs.include('validators');

if (current.getTableName() == "sc_req_item") {
current.variables.more_information_required = info_provided;
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();
event.state="stop_processing";
}

1 ACCEPTED SOLUTION

Hi,

If its the value and not the label then put it inside single quotes and test it.

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@saikatmitra 

give the select box value in quotes properly

There is this OOB business rule on sc_req_item which restricts the variable update on RITM table

It is blocking the update possibly

Name: Disallow variable edit on RITM

URL: https://instanceName.service-now.com/nav_to.do?uri=sys_script.do?sys_id=d3a6ded24f331200fc11fa218110c771

Updated script

gs.include('validators');

if (current.getTableName() == "sc_req_item") {
current.variables.more_information_required = 'info_provided'; // give proper variable value here
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

current.setWorkflow(false); // this will avoid triggering BR but it won't audit the update
current.update();
event.state="stop_processing";
}

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader