TheHive4py icon indicating copy to clipboard operation
TheHive4py copied to clipboard

Support Programmatic Creation/Deletion of Custom Fields

Open billmurrin opened this issue 7 years ago • 0 comments

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_field and delete_custom_field methods to TheHive4py API
  • Adds a static method named create_new_field to CustomFieldHelper - returns a dict that can be passed to create_custom_field.
  • Added example file test-custom-field-create-delete to demonstrate adding and deleting custom fields using the methods above.

This PR is an updated version of PR #52 (now closed).

billmurrin avatar Jan 11 '18 08:01 billmurrin