Generic Agent runs only on first matched ticket

Moderator: crythias

Post Reply
Quantin
Znuny newbie
Posts: 5
Joined: 15 May 2019, 17:07
Znuny Version: OTRS 5s (5.0.16)

Generic Agent runs only on first matched ticket

Post by Quantin »

Dear OTRS Community,

I'm facing an issue since I've migrated from OTRS 4 to OTRS 5s (5.0_16) regarding Generic Agents behavior.

For simplification purposes, let's focus on 1 specific case.
- I have 1 simple Generic Agent (GA), calling a script.
- This GA has been generated directly from OTRS interface.
- The script uses arg[0] and arg[1] to perform some operations.
- The trigger of this GA is event-based : Article Create only.
- Matched tickets are only based on the Queue : I only want the GA to be run on tickets getting new articles and present in one specific Queue (let's call it TheQ).

My issue in OTRS 5 is the following : if I receive 3 mails, which generate a ticket each in TheQ, my GA is run only on the 1st matched ticket. It is not run on the following 2 tickets, even though they match the conditions of the GA.

This statement has been made based on an analysis of the syslog, which clearly shows that the GA is run once on 1 ticket and not run after that.
The process responsible for running GA event-based in OTRS 5 and OTRS 4 seems to be the very same : otrs.PostMasterMailbox.pl
Important note : syslog does not give me any error regarding GenericAgent execution.

For the exact same GA in OTRS 4, I can see in syslog that the GA is run properly on each incoming ticket, one after the other.
I can provide further details if judged necessary.

Does someone have an idea on why the behavior of an identical GA in OTRS 4 and 5s is different ? And how can it be solved in OTRS 5 ?
User of OTRS 5s (recently migrated from OTRS 4). Current version used : 5.0.16. on Debian (Linux) with postgresql DB.
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: Generic Agent runs only on first matched ticket

Post by fcasal »

Could you post an image of the job from the generic Agent?
Quantin
Znuny newbie
Posts: 5
Joined: 15 May 2019, 17:07
Znuny Version: OTRS 5s (5.0.16)

Re: Generic Agent runs only on first matched ticket

Post by Quantin »

Hello,

Thank you for your reply.
You'll find images attached.

I precise that the images attached contain all the params for that GA :
- no automatic execution is set (based on a frequency)
- there are no update ticket actions, I only want the script to be called
- there are no external module involved also

Any leads thanks to this ?
You do not have the required permissions to view the files attached to this post.
User of OTRS 5s (recently migrated from OTRS 4). Current version used : 5.0.16. on Debian (Linux) with postgresql DB.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Generic Agent runs only on first matched ticket

Post by RStraub »

Hum... but the GA is triggered on "ArticleCreate" - how would a single ArticleCreate trigger 3 Tickets? Are you using bulk actions? In that case, it indeed should be called 3 times...
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Quantin
Znuny newbie
Posts: 5
Joined: 15 May 2019, 17:07
Znuny Version: OTRS 5s (5.0.16)

Re: Generic Agent runs only on first matched ticket

Post by Quantin »

Actually, here is the process :

- 1 email is received
- It's subject is matched by PostMaster PreFilter Module
- This create an article in the queue i'm interested in, within a pre-existing ticket (follow-up)
=> Here, the GA is supposed to be called
==>By extension, the GA script I set is supposed to be called for each ticket where an article has just been created.

This works like a charm in OTRS 4 : each email recieved generates a new article in its respective ticket, and my script is called for each impacted ticket.

In OTRS 5s this only works for the 1st processed email/article. All other article created based on the follow-up process skip the GA call.
User of OTRS 5s (recently migrated from OTRS 4). Current version used : 5.0.16. on Debian (Linux) with postgresql DB.
schulmann
Znuny wizard
Posts: 470
Joined: 20 Nov 2011, 16:08
Znuny Version: 6.5.4
Real Name: Schulmann

Re: Generic Agent runs only on first matched ticket

Post by schulmann »

Hi,
Quantin wrote: 21 May 2019, 16:47 - 1 email is received
as you said: OTRS receives one email.
The postmaster filter locates one ticket where the email has to be added.
Therefore the Generic Agent is called only once.

If you need the email to be added to all tickets then you have to send several emails to OTRS.
Your local MTA should be able to duplicate emails.

Regards
Claus-Dieter
Znuny6/Debian/ESXi
Quantin
Znuny newbie
Posts: 5
Joined: 15 May 2019, 17:07
Znuny Version: OTRS 5s (5.0.16)

Re: Generic Agent runs only on first matched ticket

Post by Quantin »

Hello,

Indeed, as I wrote :
This works like a charm in OTRS 4 : each email recieved generates a new article in its respective ticket, and my script is called for each impacted ticket.
In OTRS 5s this only works for the 1st processed email/article. All other article created based on the follow-up process skip the GA call.
I do receive several emails, each supposed to go through the GA. However as stated, only the first email received goes through the GA, and the others are just treated normally (not going through GA).

I have absolutely no clue or this difference in the behavior of OTRS between 4 and 5 for now.
User of OTRS 5s (recently migrated from OTRS 4). Current version used : 5.0.16. on Debian (Linux) with postgresql DB.
schulmann
Znuny wizard
Posts: 470
Joined: 20 Nov 2011, 16:08
Znuny Version: 6.5.4
Real Name: Schulmann

Re: Generic Agent runs only on first matched ticket

Post by schulmann »

Hi,

how do you receive the emails?
With POP, IMAP, a local MTA or another method?

Regards
Claus-Dieter
Znuny6/Debian/ESXi
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: Generic Agent runs only on first matched ticket

Post by fcasal »

Could you show the configuration of the email in admin part?
Quantin
Znuny newbie
Posts: 5
Joined: 15 May 2019, 17:07
Znuny Version: OTRS 5s (5.0.16)

Re: Generic Agent runs only on first matched ticket

Post by Quantin »

Hi,

I have attached our conf.
It's indeed IMAP.

Now that you mention it, we did alter the fetchmail configuration in OTRS5s. We never tried to use the built-in service from OTRS Deamon, we change the conf to use the old fetchmail binary.

Do you guys think it might be a good idea to set a fresh install and try the Daemon for fetchmail ? Maybe the GA mechanics depend on it.
You do not have the required permissions to view the files attached to this post.
User of OTRS 5s (recently migrated from OTRS 4). Current version used : 5.0.16. on Debian (Linux) with postgresql DB.
Post Reply