When changing the state with the trigger , the user variables that performed the action are lost


  • Used Zammad version: 5.3.0
  • Used Zammad installation type: package
  • Operating system: Red Hat Enterprise Linux release 8.6
  • Browser + version: Chrome 100+

Expected behavior:

We assigned a ticket approval status, when it was approved it should create a note and change the status to approved!

Actual behavior:

  • After execution of trigger

if we put the state change condition in the trigger, the user variables are empty, if I remove this condition from the trigger the information remains in the variable

Steps to reproduce the behavior:

create a trigger that inserts a note using the variables
#{ticket.updated_by.firstname} and #{ticket.updated_by.lastname}

Adding a status change and no change action and compare the results

I have the impression that when forcing the change of state, the system starts using user 1 instead of the user who actually approved the ticket

I’m unable to reproduce that.
If I change any ticket field while providing an article, the variable in question is correctly set.

Your screenshot only shows one - but if both variables (because you’re requesting two!) would be empty or not available, you’d receive - -.

That’s not the case here. In your case Zammad as system updated the ticket for whatever reason which is done by the system. So it’s a trigger configuration issue not a mistake by Zammad.

Thanks for the feedback ! Most likely it just returns “-” , because the user that is assuming the change is user id “1” where lastname is empty and name is “-”.

This behavior only occurs if I put the state change in the trigger, it records the correct id that would be the data of user 473 who made the approval!

As I said. I’m unable to reproduce this with the trigger configuration you’ve provided as long as an actual user is changing the state. If Zammad via e.g. Trigger or scheduler is changing the state, then the user-ID 1 behavior is technically correct.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.