Skip to main content

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!

The mapper should be searching using eventRefRange parameter rather than the Event Ref. This is what the current version of the mapper on the wiki does.

I’d expect you to get an error querying for Event Ref “R1234” - as that parameter expects an integer. Searching for Event Ref = 123 will return incident 123, R123 & P123.

You can experiment with this using assyst REST directly via Postman/Bruno/Curl etc:

/events.json?eventRef=123&fields=iid,formattedReference] responds with 123, R123, P123

/events.json?eventRefRange=123&fields=iid,formattedReference] just gives my incident 123

/events.json?eventRefRange=R123&fields=iid,formattedReference] just gives my  R123

/events.json?eventRef=R123&fields=fid,formattedReference] gives an error


The mapper should be searching using eventRefRange parameter rather than the Event Ref. This is what the current version of the mapper on the wiki does.

I’d expect you to get an error querying for Event Ref “R1234” - as that parameter expects an integer. Searching for Event Ref = 123 will return incident 123, R123 & P123.

You can experiment with this using assyst REST directly via Postman/Bruno/Curl etc:

/events.json?eventRef=123&fields=iid,formattedReference] responds with 123, R123, P123

/events.json?eventRefRange=123&fields=iid,formattedReference] just gives my incident 123

/events.json?eventRefRange=R123&fields=iid,formattedReference] just gives my  R123

/events.json?eventRef=R123&fields=fid,formattedReference] gives an error

Hi Paul,

 

that was exactly what was causing my issue, I noted that it can works with the Entity ID of the action too, but I ended using the eventRefRange as you suggested.

 

Thanks Again!


Reply