Welcome to BYC! This is a frequent question that comes up here on the forum. First of all, make sure that you have enough roosting bars that are higher than top nest boxes. Chickens will naturally gravitate to the highest place available to roost. Also, make sure that your roosting bars are made of wood, rather than metal. Metal may be easier to clean, but it,s a lot harder for chickens to grip than wood. If you are okay in these first two areas, block off the nests at night. That will keep them from using the nest boxes, and cause them to shift to the roosting bars. Leave the nest boxes blocked at night for a few days, until they become accustomed to using the roosting bars, and then you should be able to leave the nest boxes open again at night. Good luck in training your chickens to use the roosting bars.