handlers.link_fact_sheet_by_field_handler
Whenever somebody sets a specific field value, we link this fact sheet to another fact sheet.
If somebody changes the field value to something else, we remove the link to the other fact sheet.
Configuration:
field
: Name of the field to be monitored, e.g. hostingType
of an Application.
fs_type
: Fact sheet type of the fact sheets to be linked automatically, e.g. ITComponent
.
mapping
: Combinations of the value of the field and the id of the fact sheet that should be linked automatically.
Example: "saas": "abcdefff-1234-abcd-defa-12345678abcd"
Links the ITComponent abff... if the application's hostingType
value is set to "saas".
description =
'Whenever somebody sets a specific field value, we link this fact sheet to another fact sheet.'
config_template =
{'fs_types': ['Application'], 'field': 'hostingType', 'target_fs_type': 'ITComponent', 'relation': 'relApplicationToITComponent', 'mapping': {'saas': 'abcdefff-1234-abcd-defa-12345678abcd'}}