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

Filter by "are not NULL" operator ("*") does not work for custom field #42

Open
mnesarco opened this issue May 16, 2024 · 0 comments
Open

Comments

@mnesarco
Copy link

Hello, I am trying to filter by custom field, looking only for tasks with a non null value, but it refuses to work:

wps = client.get_work_package_service()
tasks = wps.find_all([Filter('customField1', '*', values=[])])

Results in error:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/test/.cache/pypoetry/virtualenvs/op-diam-Nfha37ZV-py3.12/lib/python3.12/site-packages/pyopenproject/business/services/command/work_package/find_all.py", line 30, in execute
    return FindListCommand(self.connection, request, WorkPackage).execute()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/test/.cache/pypoetry/virtualenvs/op-diam-Nfha37ZV-py3.12/lib/python3.12/site-packages/pyopenproject/business/services/command/find_list_command.py", line 13, in execute
    return self.next_page_objects(obj_list=[], json_obj=self.request.execute())
                                                        ^^^^^^^^^^^^^^^^^^^^^^
  File "/test/.cache/pypoetry/virtualenvs/op-diam-Nfha37ZV-py3.12/lib/python3.12/site-packages/pyopenproject/api_connection/request.py", line 59, in execute
    raise RequestError(f"Error running request with the URL (HTTPError):"
pyopenproject.api_connection.exceptions.request_exception.RequestError: Error running request with the URL (HTTPError): 'http://localhost:8088/api/v3/work_packages/?filters=[{"customField1":{"operator":"*","values":[]}}]'.
 {"_type":"Error","errorIdentifier":"urn:openproject-org:api:v3:errors:InvalidQuery","message":"Repetir Operator no está establecido a uno de los valores permitidos."}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/test/devel/projects/ladrilleras/OpenProject_Hooks/op-diam/op_diam/recurring.py", line 10, in <module>
    tasks = wps.find_all([Filter('customField1', '*', values=[])])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/test/.cache/pypoetry/virtualenvs/op-diam-Nfha37ZV-py3.12/lib/python3.12/site-packages/pyopenproject/business/services/work_package_service_impl.py", line 65, in find_all
    return list(FindAll(self.connection, filters, sort_by, group_by, show_sums).execute())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/test/.cache/pypoetry/virtualenvs/op-diam-Nfha37ZV-py3.12/lib/python3.12/site-packages/pyopenproject/business/services/command/work_package/find_all.py", line 35, in execute
    raise BusinessError("Error finding all work packages") from re
pyopenproject.business.exception.business_error.BusinessError: Error finding all work packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant