Update incident from email with no watermark AND 2 incident numbers in the subject line

Ricky S Larsson
Tera Guru

I'm trying to setup an inbound email action for an integration between the customer and their vendor that will update an existing incidents in the customer instance based on the INC number that is included in the email from the vendor. No watermark is included. I know there is a possibility to create an inbound action that doesn't require a watermark, just the ticker number.

Problem is, there is also another INC number (the vendor's INC) in the reply email from the vendor. The email subject line looks like this:

[Vendor's INC number] - New ticket from Customer [Customer INC number] has been assigned to Group

How would I setup an inbound action that could take the Customer INC number and match it to that incident and update it, and ignore the Vendor INC number?

Web Services / REST integration is out of the question at the moment as this vendor doesn't work with WS / REST

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi Richard,

A quick fix would be to read the subject and then fetch the customer INC number.

To do that, you need to have 1 word at least constant (pre or post) of that customer INC number. Let say, Customer followed by XXXXXX would always be there. In that case, you can simply write below code which returns the customer INC number.

var subject = "XX3234241 - New ticket from Customer 787XX2342 has been assigned to Group";
var find_str = subject.indexOf("Customer");
if (find_str > -1) {
var customer_str = subject.substring(find_str,subject.length);
var customer_no=customer_str.split(" ");
gs.print("customer number is "+customer_no[1].trim().toString());
}

Mark the comment as a correct answer and also helpful once worked.

View solution in original post

10 REPLIES 10

This is a very good way to solve it, not having to hard-code words. Thanks a bunch!