ServiceNow created 2 records via inbound actions with same record number but different sys_ids

Community Alums
Not applicable

I created a inbound actions which should create new record in ServiceNow based on certain conditions. The " When to Run " type is selected as "None". So use case is like if someone sends a reply/fwd email as well to SN , then also it should create new record.

Issue is when I'm sending a new email,  its working fine. But If I'm sending reply on the same email its creating new record with different sys_id however the record number remains the same. So as per my customizations it should create new record always (If Record number i not mentioned in email subject line) with unique record number.

To be noted there is a time gap between both the emails received in SNOW.

Example : For both cases CASE000xxxx11 is created with 2 different sys_ids.

 

Need inputs if there is gap at my end or need to take help of ServiceNow.

11 REPLIES 11

You can try what this user did, https://www.servicenow.com/community/developer-forum/inbound-action-type-quot-reply-quot-to-always-c...

 

He added current.initialize() to the top of his script. Not sure if it will work but definitely worth a try.

Community Alums
Not applicable

but this issue is occurring only if I send reply to the same email which I have already send as New email for record creation. However same issue is not observed If I'm sending reply email to a new email which doesn't exists in SNOW. This is my observations from email Log.So somehow its identifying the mail trail already there in SN and still creating Case with same case number but different ID. So my question is can it be handled so that it create new case records only.

 

Received id=<abc@cde.xxxx.PROD.OUTLOOK.COM> Classified as reply to 'CASE000287961' found via In-Reply-To header

See this for how inbound actions are processed. 

https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/administer/notification/concept/in...

Yes, it identifies email threads by matching the In-Reply-To: header to the Message ID of previous emails.

 

Your best bet might be to initiate a new gliderecord, rather than using the current object.

Example:

var gr = new GlideRecord('yourTableName');
gr.initialize();
gr.account = userAccount;
gr.contact =contactSysId; 
gr.insert();

 

Community Alums
Not applicable

I will try and let you know. Thanks.

Community Alums
Not applicable

No. Using GlideRecord isn't working in this scenario. Record itself is not getting created.