We study the interaction-induced migration of bubbles in shear flow and observe that bubbles suspended in elastoviscoplastic emulsions organize into chains aligned in the flow direction, similarly to particles in viscoelastic fluids. To investigate the driving mechanism, we perform experiments and simulations on bubble pairs, using suspending fluids with different rheological properties. First, we notice that, for all fluids, the interaction type depends on the relative position of the bubbles. If they are aligned in the vorticity direction, then they repel, if not, then they attract each other. The simulations show a similar behavior in Newtonian fluids as in viscoelastic and elastoviscoplastic fluids, as long as the capillary number is sufficiently large. This shows that the interaction-related migration of the bubbles is strongly affected by the bubble deformation. We suggest that the cause of migration is the interaction between the heterogeneous pressure fields around the deformed bubbles, due to capillary pressure.