Mailing List Archive

Run bash script on ticket creation
Hi guys,

I need to run a custom bash script when a ticket gets created, is there a
way to achive this behavoiur using the default Trac's features or a custom
plugin?
Alternatively could it be fine also perfom an http call with custom
parameters and authentication header.

Many thanks in adavance.

Regards,
Angelo.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/206435e3-f065-40b1-951e-3b8baacb1bcbn%40googlegroups.com.
Re: Run bash script on ticket creation [ In reply to ]
On Monday, January 18, 2021 at 8:37:18 AM UTC-8 Angelo wrote:

>
> Hi guys,
>
> I need to run a custom bash script when a ticket gets created, is there a
> way to achive this behavoiur using the default Trac's features or a custom
> plugin?
> Alternatively could it be fine also perfom an http call with custom
> parameters and authentication header.
>
> Many thanks in adavance.
>
> Regards,
> Angelo.
>

You could make a plugin that calls the script using ITicketChangeListener:
https://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.ITicketChangeListener

If you need to call your script at specific actions of the Trac workflow,
see run_external operation of TracAdvancedTicketWorkflow:
https://trac-hacks.org/wiki/AdvancedTicketWorkflowPlugin

You might be able to use the latter on ticket creation by adding:
create.operations = run_exernal
and adding create.py to $env/hooks with create.py calling your script using
the subprocess module.

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/b8ca6771-8060-424a-80ee-78c7e017a04an%40googlegroups.com.