Bug
| Question | Answer
|---------------------------|--------------------
| OS version (server) | Debian
| OS version (client) | Seven
| TheHive version / git hash | 3.3
| Package Type | DEB
When I'm creating tasks using the API I can produce a task that looks retrieved that way:
{
"owner": null,
"_routing": "AWqc4lWZM31j2evBe_lF",
"flag": false,
"_type": "case_task",
"description": null,
"title": "TaskTitle",
"createdAt": 1557410140945,
"_parent": "AWqc4lWZM31j2evBe_lF",
"createdBy": "api",
"_id": "AWqc4lmzM31j2evBe_lG",
"id": "AWqc4lmzM31j2evBe_lG",
"_version": 1,
"startDate": null,
"status": "Waiting",
"group": "default",
"order": 0
}
(Note that there is no owner, no startDate and no task description)
This contains compared to manual cases the attributes owner, startDate and description (its just missing if manually created and values are not set).
This leads to a javascript error:
vendor.239643a9.js:6 TypeError: Cannot read property 'name' of null
at scripts.292265cd.js:5
at fn (eval at compile (vendor.239643a9.js:8), <anonymous>:4:459)
at vendor.239643a9.js:6
at o.$digest (vendor.239643a9.js:6)
at o.$apply (vendor.239643a9.js:6)
at HTMLSpanElement.<anonymous> (vendor.239643a9.js:9)
at HTMLSpanElement.handle (vendor.239643a9.js:3)
at HTMLSpanElement.dispatch (vendor.239643a9.js:3)
at HTMLSpanElement.q.handle (vendor.239643a9.js:3)
Question:
Is the problem wrong usage of the API or a javascript error?
If it is wrong usage of API, how can this be done correct and how is it possible to unset a description/startDate/owner?
Can you provide a curl call to reproduce this task creation? so we can reproduce the JS error? Thanks
I was able to produce this by using the example from TheHive4Py test-case-create.py:
tasks = [
CaseTask(title='Tracking'),
CaseTask(title='Communication'),
CaseTask(title='Investigation', status='Waiting', flag=True)
]
# tasks = []
case = Case(title='From TheHive4Py', tlp=3, flag=True, tags=['TheHive4Py', 'sample'], description='N/A', tasks=tasks)
Ok I'll check it, thanks
@nadouani I did some investigations. The problem always occures if you load the tasks and no owner is set (list tasks, go into task).
Maxbe you want to add this to the next bugfix? I am not aware of any issues but I think if the root-cause is clear it might not be to hard to fix it ;)
Sure, I鈥檒l fix this in the next RC ;)