We have had success with the artificial vanilla-scented air fresheners. Here are the drawbacks:
1. Because they are outside, they are ineffective in roughly a week; the scented oil evaporates more quickly outside than it does inside a car or indoors. As a result, you must replace them frequently.
2. The bizarre off-brands at the dollar store only last 2-3 days at most, and they are often so old by the time you buy them that the scent is gone anyway.
The good thing is that while nothing will COMPLETELY get rid of the flies, vanilla air fresheners cuts back on them significantly. I think there's something about the fake vanilla scent that they don't like. I have not tried other scents to see if they might also be effective, but we tried the vanilla air freshener technique, and it did effectively make a noticeably significant difference on the number of flies buzzing about.
Scraping/cleaning up the poo also helps cut down on the flies. Hard to do with a free range flock, tho, but if your flock is in a pen/run, try to stay on top of scraping it up as much as possible and put it in your compost pile.