Update existing record via Inbound Action without Watermark

Josh80
Tera Expert

Hello

I'm sure this requirement has surfaced for other folks, but I can't find much about it.

REQ:

Update existing RITM or Incident from a 3rd party platform.

Subject should contain a reference to the 3rd party platform including the ticket number and kick off the inbound action

Script I'm assuming should query the table (ritm or incident), grab the value of a field and match against the ticket number in the subject

Anyone have any experience doing this?

Thanks in advance!

1 ACCEPTED SOLUTION

Actually just found this along with script using regex...I think I could get this to work.



Thanks!



Re: Re: Inbound Email Actions - able to match an existing incident based on a ticket number from pre...





****UPDATE**** I did get this to work along with the Cart API. Very cool!


View solution in original post

9 REPLIES 9

I did something before using indexOf where ID: xxxxx is emailed in. Maybe this script will give you some ideas too:



var str = email.subject.toLowerCase(); //gets the subject line


var start = str.indexOf(':'); //gets the position number of ':'


var start2 = start + 2; //add 2, so you start after "; " (space included)


var end = str.indexOf(' ', start2); //this gets the numbers starting after the ': "


var end5 = start2 + 5; //incase the ID: xxxxx is at the end of the subject line, get the numbers here



//if the ID: xxxxx is at the end of the subject, the value of end will be -1.



if (end == -1)



      current.u_external_ref_number = str.slice(start2, end5);



else



      current.u_external_ref_number = str.slice(start2, end);


Ok - I have this working for the Incident table.



Now, I have to work on the Request inbound action that uses the Cart API.



Unfortunately, it's not just a matter of copying/pasting the code I've tweaked into the inbound for Request - I'm receiving an error message before saving regarding syntax.



'Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.


Can you provide screenshot?


Kalaiarasan Pus
Giga Sage

I would just like to extend what Michael.Fry told.



Creating a dedicated user account for such integration is the best way forward. This would you help to set up right set of access and restrict actions that the performed by the third party tool. It would help you in avoiding 'guest user' processing and related security overhead. Also, it would high you in debugging and trouble shooting in case of any issues since all your third party activity can be tracked using the dedicated account.


Daniel Shock
Kilo Sage

I need to do exactly this.  I have inbound email from microsoft with an email address in the body of the email that I need to match with a requested item.  Can you share more specifically your script and how you were able to get this working?