Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi, Is There A Way To Apply "And" Logic In Task.Get_Tasks() 'S Task_Filter?

Hi, is there a way to apply "AND" logic in Task.get_tasks() 's task_filter?
Task.get_tasks(project_name="project", task_name="task", task_filter={'tags': [f"pipe: pipe" ??AND?? "training"]})Currently when given a list of tags (for example) it applies an 'OR' logics only

  
  
Posted 3 years ago
Votes Newest

Answers 9


Hi SmarmySeaurchin8 ,
This is currently not supported. We'll probably add this in the next release using the following notation:
task_filter={"__$all", "pipe: pipe", "training"}
which will not support complex conditions (i.e. no compound and and or conditions) but will allow you to apply the operator to the entire list...
Does that sound reasonable?

  
  
Posted 3 years ago

For simplicity I wouldn't like a complex structure and I'd like to use a unique term. $all would be nicer, but that would prevent you from using $ in your tags, which doesn't seem likely...

  
  
Posted 3 years ago

Hmm, that's quite an uncomfortable syntax. How does this work with wanting to apply an "AND" logic only to tags, in the task_filter?

  
  
Posted 3 years ago

Oh, sorry, I messed up, I meant:
task_filter={"tags": ["__$all", "pipe: pipe", "training"]}

  
  
Posted 3 years ago

Well, it's making more sense but still quite ugly, hehe

  
  
Posted 3 years ago

I see haha

  
  
Posted 3 years ago

😄

  
  
Posted 3 years ago

you could do something like 'tags':{'AND':['pipe','training']}
And the user could decide if he wants AND or OR logic

  
  
Posted 3 years ago

__$ is a more rare prefix 😄

  
  
Posted 3 years ago
636 Views
9 Answers
3 years ago
one year ago
Tags