Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Alert Custom Field with integer value #1588

Closed
rriclet opened this issue Oct 22, 2020 · 0 comments · Fixed by #1615
Closed

[Bug] Alert Custom Field with integer value #1588

rriclet opened this issue Oct 22, 2020 · 0 comments · Fixed by #1615
Assignees
Labels
bug TheHive4 TheHive4 related issues
Milestone

Comments

@rriclet
Copy link
Contributor

rriclet commented Oct 22, 2020

Bug

Work Environment

Question Answer
OS version (server) Ubuntu
OS version (client) Ubuntu
TheHive version / git hash 4
Package Type From source

Problem description

Creating an alert with an integer custom field gives a BadRequest error (see curl below)

Steps to Reproduce

curl -s -u<user>:<password> -H 'Content-type: application/json' -H 'X-Organisation: <org>' http://127.0.0.1:9000/api/alert -d '{"type": "test-alert", "source": "script", "sourceRef": "8", "title": "Title", "description": "alert description","customFields":{"business-risk":false,"cvss":2}}' 

is answered by

{
  "type": "BadRequest",
  "message": "Invalid value type for custom field.\r\n  Expected: integer\r\n  Found   : Some(2.0) (class scala.Some)\r\n                             "
}

Possible Solutions

Allow a integer custom field to accept Float/Double types ?

@rriclet rriclet added bug TheHive4 TheHive4 related issues labels Oct 22, 2020
@rriclet rriclet self-assigned this Nov 4, 2020
@rriclet rriclet added this to the 4.0.1 milestone Nov 4, 2020
@To-om To-om linked a pull request Nov 4, 2020 that will close this issue
@rriclet rriclet closed this as completed Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug TheHive4 TheHive4 related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant