Enhance trigger and scheduler to run a given script

Hi community,

right now you could use trigger and scheduler to send a mail or do some actions with the ticket.
What do you think about the idea, enhance the trigger and scheduler with the option to run any given script.

Think about the following process/usecase:
Support is getting a ticket to create a new user account in Active Directory.
In the ticket the department is providing any mandatory information like “firstname, lastname, department, …”
Support checks the ticket and the given information and adds the tag “create user by script”.

Given that zammad is able to run any given script by trigger you could set up a trigger in the following way:
If ticket = open and tag = “create user by script”

  1. run script “create user”.
  2. add tag “user created by script”
  3. close ticket

There could be so many usecases by automating tasks based on zammad tickets.

What do you think about it?

Please leave you comment to this post to give the core team an idea of how many people would like such a feature.

Best regard
Gerhard

P.S.
Probably it would be a lot work to implement this feature in the gui.
But maybe it is possible to do it on the command-line with less effort?

@martini
Is there already an option to do something like trigger on the command-line?
i.e. get all tickets for given condition with all fields belonging to these tickets?

1 Like

It sounds handy. The script will have to be written with security in mind when parsing text from the email to stop shell injection or other types of attacks.

In the meantime you could do what you want by setting up an email address on your mail server and have the trigger forward the email that address, then have a script running somewhere that checks for new emails via imap in that inbox, parse the email and do whatever you like.

@chesty
I´m not thinking of parsing the text of the mail to the script.
I think using the ticket fields would be enough.
Also you could use the zammad build-in validity for the tickets-fields to get correct input for the scripts.

“In the meantime you could do what you want by setting up an email address on your mail server and have the trigger forward the email that address, then have a script running somewhere that checks for new emails via imap in that inbox, parse the email and do whatever you like.”

Correct. Sending a new mail with just the ticketfields to another Mailbox should work as a workaround.
Thanks for the idea.

Anyway. Enhencing the trigger by “run script” would be my favourite workflow. :wink:

Cheers.

I’d love to see this too! is there any news on this?

This topic was automatically closed after 416 days. New replies are no longer allowed.

Hello Gerhard,

by now we have our WebHooks that would be a great alternative and work for trigger and scheduler.

Issue which we see with executing scripts:
a) Scripts may have negtive impact on the system stability.
b) On triggers, scripts may block updating tickets if the execution if the script takes longer.
c) On hosted instances we can’t support this because of security reasons.

Note: WebHooks in Zammad are asyncron

Best
Mirta