GenericAgent issue with event trigger TicketCreate

Moderator: crythias

Locked
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

Hi,

i configured new GenericAgent that executes my custom module that i previously registered in config.pm.
all working find when running GA from admin GUI (manually).

Problem is somewhere in this GenericAgent - its configured for Event Based execution with CreateTicket trigger.

On newly arrived ticket(via mail) I can see it has been triggered after:

Code: Select all

[Info][Kernel::System::Ticket::TicketCreate] New Ticket [28749628/test11] created (TicketID=649748,Queue=TEST,Priority=3 normal,State=new)
after that:

Code: Select all

[Notice][Kernel::System::GenericAgent::JobRun] Run GenericAgent Job 'CRM - TEST' from db.
But nothing happens, it never executes. When i run this GA manually - otrs successfully selects that ticket and I can run GA via "Run job button".
Then i can see in logs:

Code: Select all

[Notice][Kernel::System::GenericAgent::JobRun] Run GenericAgent Job 'CRM - TEST' from db.
[Notice][Kernel::System::GenericAgent::_JobRunTicket] Use module (Kernel::System::GenericAgent::WriteToFile) for Ticket (28242642/642763).
I tried everything, can you please give me advice whats the problem?
It seems the OTRS is never really processes GA jobs on event TicketCreate.

BR!
OTRS 6.0.3-1, MySQL
hkais
Znuny wizard
Posts: 359
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: GenericAgent issue with event trigger TicketCreate

Post by hkais »

can you share the configs of your GA in:
- Automatic Execution (Multiple Tickets)
- Event Based Execution (Single Ticket)

Sounds for me like an issue here.
Also from your description it sounds like the behavior is properly working, if you selected event based execution, and the event is TicketCreate.
It may be that you require to use ArticleCreate if you want to have all types of changes of your ticket
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO power users and admins
Specialized for AI-based Solutions with Znuny

IT Governance Portal
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

I Attached Single and Multiple Tickets. Nothing special i guess.
Screenshot 2025-01-31 at 08.26.37.png
TicketCreate should execute when Ticket is created, but it will not. I also tried ArticleCreate but does not work too.
What do you mean by "its working correctly", GA is not processed - ticket update part or script execution is not done by this GA.
You do not have the required permissions to view the files attached to this post.
OTRS 6.0.3-1, MySQL
hkais
Znuny wizard
Posts: 359
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: GenericAgent issue with event trigger TicketCreate

Post by hkais »

can you ensure that the exec of your GA is not done?
We had similar issues with a bug in our module and thus it did not get executed form the viewpoint.

if you add a note to your GA, is this Note also missing?
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO power users and admins
Specialized for AI-based Solutions with Znuny

IT Governance Portal
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

Yes, i tried adding note, but there is no note in ticket. I can get rid of my custom module execution and only wanted to change priority and add note, but either is not done.
OTRS 6.0.3-1, MySQL
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

hkais wrote: 31 Jan 2025, 09:47 We had similar issues with a bug in our module and thus it did not get executed form the viewpoint.
how did you debugged it?
OTRS 6.0.3-1, MySQL
hkais
Znuny wizard
Posts: 359
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: GenericAgent issue with event trigger TicketCreate

Post by hkais »

with the first named step:
ensure the GA gets called at the time it is required.

The easiest way:
  • add note to GA
  • remove your module (temporarily)
  • check if GA executes now
    If not => your query wrong or your event wrong
  • if it executes like expected, re-add your module
  • add into your module debug log output, to see if it is getting called (shall be the case)
  • recheck again the automatic GA execution, it shall do the same and still add the note and is shall execute your module...
  • if GA still called, but module not executed, recheck you module config in your GA
and many more steps.

Maybe we can mutually write an article about how to do good debugging for Znuny modules.
Ping me via PN if interested and would like to get some public OpenSource charma points...
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO power users and admins
Specialized for AI-based Solutions with Znuny

IT Governance Portal
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

Hi,

I did:
  • add note to GA
    remove your module (temporarily)
    check if GA executes now
I tested it :

Feb 11 16:50:01 otrs OTRS-CGI-18[28376]: [Info][Kernel::System::Ticket::TicketCreate] New Ticket [18753411/test15] created (TicketID=753531,Queue=XX::XX,Priority=3 normal,State=new)
Feb 11 16:50:01 otrs OTRS-CGI-18[28376]: [Notice][Kernel::System::GenericAgent::JobRun] Run GenericAgent Job 'CRM - TEST' from db.

Job is indeed Run (its name is CRM - TEST). It should only add note, nothing else.
But note is not added. When I run it manually, it works.
You do not have the required permissions to view the files attached to this post.
OTRS 6.0.3-1, MySQL
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate

Post by Snowmanko »

hkais wrote: 31 Jan 2025, 16:14 Maybe we can mutually write an article about how to do good debugging for Znuny modules.
Ping me via PN if interested and would like to get some public OpenSource charma points...
Sure, why not, I love OTRS, using it 15 years :) I will be more than happy to help.
OTRS 6.0.3-1, MySQL
hkais
Znuny wizard
Posts: 359
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: GenericAgent issue with event trigger TicketCreate

Post by hkais »

Snowmanko wrote: 11 Feb 2025, 17:54 Job is indeed Run (its name is CRM - TEST). It should only add note, nothing else.
But note is not added. When I run it manually, it works.
If I understood you well, you have added in the GA to add a note.
If you execute the GA to run manually via Generic Agent "Run" the note ist added properly

if you let the GA run automatically it is not executed well, right?

If so, your selected Event is either wrong or your select criteria in just that moment is wrong.
Without the select criteria is hard to help you here.

Hint:
- Article create is a option to test, often Ticket create is mixed up with Article Create (Ticket create is basically the very first Article #1 create timepoint),
where Article Create Event is triggered on each Article in Ticket. E.g. if you expect an reply.
But also the Update could be a good Event, depending on what you want to achieve
- the other issue often is that the select criteria is wrong at the timepoint the article/ticket arrives your system. Your GA Run operation is a totally different timepoint and sometimes even a experienced person is not fully aware of it
- cannot imagine that this basic issue is the case, but I assume you have ensured your cron is triggering the Generic Agents execution of Znuny, and other GAs are running and are executed?

If possible you can share here screenshots or via private message more details.
E.g. of your select criteria which often explain better what you want to achieve.

Regarding the open source cudos, please message me privately, so we can discuss how to progress.
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO power users and admins
Specialized for AI-based Solutions with Znuny

IT Governance Portal
Snowmanko
Znuny newbie
Posts: 71
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: GenericAgent issue with event trigger TicketCreate [solved]

Post by Snowmanko »

I was able to solve it with creation of new GA. I dunno whats bad in old GA, it looks ok, but I could overseen something bcs I have more than 200 dynamic fields. Thank you.
OTRS 6.0.3-1, MySQL
Locked