Hi everyone,
I have a channel with different datamappers, the main goal of the channel is to monitor a mail address and when a mail arrives it creates a new event or an action on an existing event, based on the content of the mail’s subject. The firs mapper if to set the variables, the second to create an event, the third to create an action and the last two manage the attachments for these situations.
Recently the incident IDs and the request IDs are coming closer, and now I have some trouble with one of my datamappers.
This particular datamapper is activate when an event id already exists and try to insert a new action in the event itself. However, if it tries to write a new action on an incident and there is a request with the same id, the import failed with the following error:
Trying to debug a random import, i get this situation in my event field
Basically, it finds two events with the same numbers (but registered with different CSGs), although one is a request with the prefix R and one is an incident without prefix.
This is happening only for the incidents, in fact if the mapper finds a request event, the action is correct and the import succeed; for example, the problem is if I have the event ref 1234 and the event R1234
Anyone could suggest me how I can avoid this particular behavior?
This is the variabile I use to find the event id in my mail’s subject, basically try to find a mandatory “REF” parameter and then the classic event structure
var re = /cRr]>EeIi]eFf]/^a-zA-Z0-9]*(]I|i|R|r|P|p|S|s|T|t|D|d]?p0-9]+)/;
var matches = re.exec(headersr'Subject']);
if(matches){
var ref = matchesr1];
Thanks in advance!