There are many space probes that flew past asteroids, some came close to it, some orbited and some landed on it and took samples but those asteroids belonged in the main belt. Now, Lucy will become one of the two space probes that is set to explore the Jupiter Trojans. It was planned in 2017 and is set to launch in October 2021. But why it took so long to plan a mission for Jupiter Trojans? Most of the previous asteroid missions were planned and executed in the early years of 21st century and even flybys were done by Galileo and Cassini. The success rate of asteroid flyby and exploration missions were quite high including asteroid mining missions considering how difficult those missions were. So, why exploration of Jupiter Trojans were not planned in those previous missions? Is it due to their complex orbits? Or due to financial reasons?
The first asteroid flyby missions were secondary missions: on its way to Jupiter, Galileo flew by a few asteroids that were close to its trajectory to Jupiter.
The first mission that changed its course to get close to an asteroid was Clementine, which was planned to do a flyby of 1620 Geographos. Geographos got very close to Earth.
The next missions were all near-Earth asteroids. It's much easier to get to a near-Earth asteroid than to get to Jupiter.
Ulysse Carion's "subway map" demonstrates this:
This image shows you need to change the spacecraft's speed by 9400 + 3210 + 3360 m/s is 15.9 km/s to get to Jupiter, while an Earth escape to get to a near Earth asteroid takes 9400 + 3210 is 12.6 km/s. This means you need a bigger rocket for a Jupiter trojan mission than for a NEA mission. The long transit time to Jupiter also makes the mission more expensive.
In general, the first mission to a new type of target is designed to minimize cost and risk, so you pick a nearby target that's easy to reach. Once the concept has been proven, bigger, more expensive missions are designed to reach targets farther away. We explored Mars before we went to Saturn, for instance.