handlers.link_fact_sheet_by_subscription_handler
Example use case: If an Application Owner is added or removed from an Application, this automation looks up the
Organization of the subscribed user and links it as owning Organization (usageType: owner).
Generic logic: We configure a mapping of roles and usageTypes, like this:
"Application Owner": "owner",
"Component Manager": "componentOwner",
and also a means to identify the corresponding fact sheet:
"user_field_source": "userProperty" or "lansweeper" or "entraID" (to be implemented)
"user_field": "Department",
"linked_fs_type": "Organization",
"match_field": "shortName"
"role_field": "usageType"
The automation will then monitor all subscription events (added/removed/updated), look up the correct fact sheet,
unlink any previously-linked fact sheets of this usage type and link all fact sheets that need to be linked,
or update the usage type if the fact sheet is already linked.
To specify what happens if a user is unsubscribed, you can use the following options: "deletion_action": "delete_relation" or "delete_usage_type"
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).
Called automatically whenever a FactSheetUpdated event comes in via webhook.
Inherited Members
- handlers.eventhandler.EventHandler
- get_trigger
- get_event_types
- get_fs_types
- get
- all
- lx_client
- initial_sync_event
- update_with_uniqueness_check
- facet_matches
- is_tag_key
- SUBSCRIPTION_TYPES
- parse_subscription_key
- get_mapped_subscriptions
- get_notification_users
- get_send_email_for_users
- get_email_callback
- get_due_date