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] The filter operator "_child" is missing #1344

Closed
To-om opened this issue May 20, 2020 · 0 comments
Closed

[Bug] The filter operator "_child" is missing #1344

To-om opened this issue May 20, 2020 · 0 comments
Assignees
Labels
bug TheHive4 TheHive4 related issues
Milestone

Comments

@To-om
Copy link
Contributor

To-om commented May 20, 2020

Request Type

Bug

Work Environment

TheHive 4.0.0-RC2

Problem Description

In TheHive 3, the filter operators "_parent" and "_child" are used to build complex filter over object hierarchy (filter on case and related tasks for example).
In TheHive 4, the operator "_parent" exists but "_child" is missing. The latter is not used by the frontend but by TheHive4py.
The following Python code

query = And(
    Eq("title", "[DATALEAK] test"),
    Child('case_artifact', And(
        Eq('dataType', 'mail'),
        Eq('data', 'my@email.com')
    ))
)

which produces the raw query

{
  '_and': [{
    '_field': 'title',
    '_value': '[DATALEAK] test'
  }, {
    '_child': {
      '_type': 'case_artifact',
      '_query': {
        '_and': [{
          '_field': 'dataType',
          '_value': 'mail'
        }, {
          '_field': 'data',
          '_value': 'my@email.com'
        }]
      }
    }
  }]
}

doesn't work.

@To-om To-om added bug TheHive4 TheHive4 related issues labels May 20, 2020
@To-om To-om added this to the 4.0.0-RC3 milestone May 20, 2020
@To-om To-om self-assigned this May 20, 2020
To-om added a commit that referenced this issue May 20, 2020
@To-om To-om closed this as completed May 20, 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

No branches or pull requests

1 participant