Inbound action or Business Rule issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 06:26 AM
I have a vendor that is sending me updates to an existing incident from an external email. There is one part of the subject line that doesn't change for every email I receive from the vendor. I have an inbound rule that creates the initial incident but can't figure out how to get the additional NEW email update information from the vendor put into the additional comments of the original email. The vendor is unable to send subsequent updates to the order\issue as a REPLY. This causes multiple incidents for a single order to be created instead of a single incident containing all of the information for the order\issue. Should I use another inbound rule to handle the new incoming emails or should I use a business rule for the entire process? This is causing extra work and we are unable to track the history of these issues.
I will attach an example of an order with an incident and all the new emails related to the order\issue. The subject line contains [BCM #: XXXXXX]. The "X" in the brackets represent the ticket number of the vendor and does not change. The [BCM#: XXXXXX] customer order number does change for each individual order. I am attaching an example for reference. I need to know how to create an incident for the initial order request and then add the body of any update emails to the original incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 07:41 AM
@George Z : Assuming that the initial email doesn't have additional comments, can we use that as an identifier to determine if it's new or an update to an existing ticket?
if (email.body_text.additional_comments) {
// Add your creation logic
} else {
// Add your updation logic
}
Please make sure that the "Stop processing" checkbox is checked so that it doesn't look for any other inbound actions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 09:28 PM - edited ‎12-26-2023 09:29 PM
Hi,
You can have only one Inbound action with the below Action script
var m = "[BCM#: XXXXXX]";
var regex = /\[(.*?)\]/;
var matched = regex.exec(m)[1];
gs.print(matched);
var b = matched.split(":")[1];
b = b.trim();
gs.print(b);
var grinc = new GlideRecord("incident");
grinc.addQuery("number", b);
grinc.query();
if (grinc.hasNext()) {
//do the update code
} else {
//create incident
}
Output
Thanks,
Narsing