In the present studies, we aimed to understand how approach and avoidance states affect attentional flexibility by examining attentional shifts on a trial-by-trial basis. We also examined how a novel construct in this area, task context, might interact with motivation to influence attentional flexibility. Participants completed a modified composite letter task in which the ratio of global to local targets was varied by block, making different levels of attentional focus beneficial to performance on different blocks. Study 1 demonstrated that, in the absence of a motivation manipulation, switch costs were lowest on blocks with an even ratio of global and local trials and were higher on blocks with an uneven ratio. Other participants completed the task while viewing pictures (Studies 2 and 3) and assuming arm positions (Studies 2 and 4) to induce approach, avoidance, and neutral motivational states. Avoidance motivation reduced switch costs in evenly proportioned contexts, whereas approach motivation reduced switch costs in mostly global contexts. Additionally, approach motivation imparted a similar switch cost magnitude across different contexts, whereas avoidance and neutral states led to variable switch costs depending on the context. Subsequent analyses revealed that these effects were driven largely by faster switching to local targets on mostly global blocks in the approach condition. These findings suggest that avoidance facilitates attentional shifts when switches are frequent, whereas approach facilitates responding to rare or unexpected local stimuli. The main implication of these results is that motivation has different effects on attentional shifts depending on the context.