Event system alternative?


#1

Hi there,

I want to implement a callback which automatically creates a calendar event when a new task is created.
I thought about writing some custom events which are triggered when creating or updating a task but in the documentation it says:

The event system is an artifact of a bygone era. Use of the event system is strongly discouraged. We have been removing events since 2013 and will continue to remove events in the future.

So what’s the actual way to do this?

Cheers


#2

If you want to call an external system, https://secure.phabricator.com/book/phabricator/article/webhooks/ is your best way forward, using Herald to make the call.

If you want to create a Phabricator Calendar Event, that’s a bit trickier - you could use Herald to create the event (“Whenever a task is created, build this event”), except that I don’t think there’s an existing Herald Action for creating an event (And the UI for it would be hard to implement).
To get it done internally, you’ll need to add a class for HeraldAction that will do all the logic - something like https://secure.phabricator.com/P1896 (Although this example might be a little dated).