handlers.set_field_on_field_update_handler

class SetFieldOnFieldUpdateHandler(handlers.eventhandler.EventHandler):

Whenever a fact sheet field changes to a specific field value, we set another field to a target value.
You can use this to catch manual lifecycle changes, which you cannot do in LeanIX Automations.

Configuration:
field: Name of the field to be monitored, e.g. lifecycle of an Application.
condition: Key/value pair that will be checked, e.g. lifecycle_status: endOfLife. If the condition holds true, we will set the field as specified.
mapping: Combinations of the value of the field and the value of the target field.

Example: "endOfLife": "inactive"
Sets an application to inactive if somebody manually changes its lifecycle to endOfLife.

name = 'Set field on field update'
description = 'Whenever somebody sets a specific field value, we set another field to a target value. Very helpful for catching a manual lifecycle change to endOfLife.'
conditions = {'event_types': ['FactSheetFieldUpdatedEvent']}
supports_initial_sync = True
config_template = {'fs_types': ['Application'], 'field': 'lifecycle', 'condition': {'lifecycle_status': 'endOfLife'}, 'target_field': 'operatingStatusAutomationTrigger', 'mapping': {'endOfLife': 'yes'}}
def handle(self, event, fs, **kwargs):

Called automatically whenever a FactSheetUpdated event comes in via webhook.

def initial_sync_event(self, fs):