TheHive4py
TheHive4py copied to clipboard
Support Programmatic Creation/Deletion of Custom Fields
The new CustomFieldHelper is useful for adding a custom field(s) to a case or case template, but cannot be used to create a new custom field in TheHive. There are several fields missing such as reference, options, and description - all of which are required fields in TheHive GUI. This PR provides the ability programmatically create (or delete) Custom Fields. This feature is useful for deploying TheHive in multiple environments and wanting to utilize a standardized naming convention.
This PR adds the following support:
- Implements new exception
CustomFieldException - Adds
create_custom_fieldanddelete_custom_fieldmethods to TheHive4py API - Adds a static method named
create_new_fieldto CustomFieldHelper - returns a dict that can be passed to create_custom_field. - Added example file
test-custom-field-create-deleteto demonstrate adding and deleting custom fields using the methods above.
This PR is an updated version of PR #52 (now closed).