Skip to content

MsGraph Todo $filter works incorrectly when have combination of and\or logic conditions #3930

@23W

Description

@23W

Describe the bug
I try to requesting ToDo tasks by MsGraph API from some list and filtering criteria:

  • get all tasks that have either Start or Due dates
  • and their Title contains some specific text ("dates" in example).

The request is https://graph.microsoft.com/v1.0/me/todo/lists/{myListId}/tasks?$filter=contains(title, 'dates') and (startDateTime/dateTime ne null or dueDateTime/dateTime ne null)

Ms Graph processes this request incorrectly.
It returns result that ignores contains(title, 'dates') criteria and filters by startDateTime/dateTime ne null or dueDateTime/dateTime ne null only.

To Reproduce
Steps to reproduce the behavior:

  1. You need to have some ToDo tasks list with tasks that have setup start or due dates. One of the task should have "dates" in its title.
  2. Go to Graph Explorer, login with you account that has access to you ToDo tasks list and provide required rights (Tasks.ReadWrite)
  3. Execute request https://graph.microsoft.com/v1.0/me/todo/lists/{myListId}/tasks?$filter=contains(title, 'dates') and (startDateTime/dateTime ne null or dueDateTime/dateTime ne null) where {myListId} is Id of your tasks list
  4. See error. Result will ignore contains(title, 'dates') criteria and returns tasks filtered by startDateTime/dateTime ne null or dueDateTime/dateTime ne null only.

Expected behavior
MsGraph Todo Service should correctly process $filter criteria and returns the tasks that suits only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triaged-Unassignedissue that is triaged but unassigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions