Inbound Actions - Update Incident (BP) creates new Incident

SNowUser11
Kilo Guru

Hello Experts,

I am facing an issue. Although it is working for the OOB inbound actions 'create incident','create incident (forwarded) and Update Incident (BP). I am getting perfectly results as per these actions. Now My scenario is 

- I want to update an incident when an email comes as forwarded for any incident emails like example

FW:Incident INC0001234 has been opened on your behalf 

what could be the simple way to achieve this i tried creating another 'Update Incident (BP) with action as Forward but it seems created a new incident running this. Not getting why? Any suggestion please do not want to go with scripting unless it is not achievable in inbound actions

Thanks

1 ACCEPTED SOLUTION

SNowUser11
Kilo Guru

Just in case what at last I did to work if that helps anyone

-Created new Update Inbound Action (as Forward), Stop processing -checked.order=10

-script which helped

--------------------------

gs.include('validators');
var str = email.subject.toString();
var regex = new SNC.Regex('/INC\\d{7}/im');
var incnum = regex.match(str);
if(incnum!= null)
{
var target = new GlideRecord('incident');
target.addQuery('number',incnum);
target.query();
if(target.next() && target.getValue('state') != IncidentState.CLOSED)

target.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
target.update();
sys_email.instance = target.sys_id;
sys_email.target_table = target.getTableName();
sys_email.update();

}
}

-------------------------------------

 

View solution in original post

21 REPLIES 21

Hi,

It shows like that because the current record is not updated. you have fetched the record and did the update in the email inbound action. So from inbound action point of view, no record is created or updated.

Hope this clarified. Kindly mark it helpful/correct if this answers your question.

Yeah makes sense. Thanks

David Rolfe
Kilo Guru

How are you relating the inbound email to an existing incident record?  Normally the update incident action looks for the watermark.  Is that there in these forwarded emails?  

find_real_file.png

Hello David

Yes we are not deleting any watermark. This is there in the email. I am not really getting why the update is not working for FORWARD. Tried many ways putting in condition builder that subject contains INC . strange thing is as i mentioned above the inbound action is processed but cretes incident as I see in email logs

Thanks

If the watermark is there, you shouldn't need the "contains" condition.  And you moved this new action up the execution order?  Say 10 for this one and 20 for the original forward action?