Describe the bug
Deletion of a case is not possible when comments (for any case item) are present in the case. On deletion via "case management" in WebGUI all case related objects are deleted, but the case itself remains.
Log error says:
sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or delete on table "cases" violates foreign key constraint "comments_comment_case_id_fkey" on table "comments"
DETAIL: Key (case_id)=(xxx) is still referenced from table "comments".
To Reproduce
Steps to reproduce the behavior:
Create a new case
add an element to the case (e.g. asset / IOC)
Add an comment to the new element
Go to: Case Management
Select the newly created case
Open the case and click "Delete case"
An Error message will appear
Expected behavior
With deletion of the case all case related objects should be deleted/removed inclusively the case itself.
Desktop (please complete the following information):
Describe the bug Deletion of a case is not possible when comments (for any case item) are present in the case. On deletion via "case management" in WebGUI all case related objects are deleted, but the case itself remains. Log error says:
To Reproduce Steps to reproduce the behavior:
Expected behavior With deletion of the case all case related objects should be deleted/removed inclusively the case itself.
Desktop (please complete the following information):