What is the preferred way to loop over items with varying when statements?

I’ve got cases where I want to run the same task multiple times, with minor variances. I’ve been implementing that with a loop where each item has a property for its when statement, and the task itself resolves that property. With 2.3, I now receive warnings about the jinja expression. I can’t refer directly to the item’s when statement, since that’s handled as a string (and will resolve to true). What’s the best way to accomplish this, warning-free, in 2.3? Is there a filter I can use to do the evaluation?

Thanks,
Ed

In when: the curly brackets is implied, so just remove them at the message says.

   when: item.condition

The problem with just “item.condition” is item.condition is handled as a string (not an expression). As a result, both “7 < 4” and “7 > 4” evaluate to true.