Incoming Email To update work notes if an INC was previously created.

Tyler Johnson
Tera Expert

Good morning, 

 

I recently was asked about the possibility of updating work notes on an INC that was created by an incoming email. 

 

The ask was if it was possible to allow all incoming emails to be added to the work notes on an INC that was initially created due to an outage. Our system currently creates an INC every time an outage is detected however it's the same item that is affected. They don't want 20 INCs for the same issue instead they asked to see if we could just update the work notes of the initial INC that was created.  A unique identifier UniqueFailureID=PROD:473298472389 does exist at the bottom of the email body. This identifier is a reference to the same issue. Can we use this to only create a INC for the initial incoming email then all future Onces with this identifier will just update the work notes? 

 

 

1. Outage occurs for item UniqueFailureID=PROD:473298472389

2. Email gets sent to ServiceNow

3. Inital INC is created for this item.

4. Another outage for same item occurs UniqueFailureID=PROD:473298472389

5. ????? Can this update the worknotes only of the inital INC using the unique id as a reference to update it?

1 ACCEPTED SOLUTION

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Tyler Johnson ,

Are you storing this " UniqueFailureID=PROD:473298472389" information somewhere on incident. if yes, 

In inbound email action you can glideRecord to the incident and query the Field where this " UniqueFailureID=PROD:473298472389" is updated. and check if the UniqueFailureID is different create a incident or else update the same incident worknotes.

From the received email body in servicenow you can extract the UniqueFailureID and GldieRecord the incident table.

 

Please let me know if you have more questions.  Also if possible please share the  exisintg inbound action if you have created and email body.

 

Thanks,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

View solution in original post

2 REPLIES 2

Sumanth16
Kilo Patron

HI @Tyler Johnson ,

 

You can query incident table  in Inbound email action and do the orderBy  system created on field and add setlimit function like below:

grug.orderBy('sys_created_on');

grug.setLimit(1);

 

From here you can get the first record created.

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

 

 

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Tyler Johnson ,

Are you storing this " UniqueFailureID=PROD:473298472389" information somewhere on incident. if yes, 

In inbound email action you can glideRecord to the incident and query the Field where this " UniqueFailureID=PROD:473298472389" is updated. and check if the UniqueFailureID is different create a incident or else update the same incident worknotes.

From the received email body in servicenow you can extract the UniqueFailureID and GldieRecord the incident table.

 

Please let me know if you have more questions.  Also if possible please share the  exisintg inbound action if you have created and email body.

 

Thanks,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.