handlers.eventhandler
Base class for all event handlers. All event handlers need to be derived from this class.
Declare the exact fact-sheet data this handler needs, so the webhook event loop (process_event in workspace/views_module.py) can load a single lean FastFactSheet per event instead of the full fact sheet.
Return a dict:
{
"fields": [
Return None (the default) to signal "requirements cannot be declared statically" - e.g. handlers that exec/eval config-supplied code. The event loop then loads the full fact sheet for that event, so correctness is always preserved. This is a standalone hook (deliberately not tied to the initial_sync_* hooks, which are slated to migrate onto it later).
Parses a SUBSCRIPTION mapping key "subscriptions/
is RESPONSIBLE, ACCOUNTABLE or OBSERVER (case-insensitive). Empty, "*" or "ANY" means any type, so the common legacy form "subscriptions// " keeps matching the role regardless of type. Any other value is ignored with a warning (legacy configs used it as a free-text label). is everything after the second slash, so role names containing "/" work as-is ("subscriptions/RESPONSIBLE/Sales/Marketing Owner"). An escaped "\/" is accepted as well. An empty role selects the role-less subscriptions of that type. - The legacy two-part form "subscriptions/
" matches the role with any type.
Returns the subscriptions of fs selected by a SUBSCRIPTION mapping key, see parse_subscription_key().
subscription_filter: optional dict of subscription attribute -> regular expression, e.g.
{"comment": "IT-Architect"} (a mapping's "subscriptionFilter"). Only subscriptions whose attributes all match
(re.search; a missing/None value is matched as "") are returned - if none match, none are returned.
user_filter: optional callable(user) -> bool. Users for which it returns False are skipped as if they were not
subscribed, so that __FIRST_MATCHING__ falls through to the next role.