As a defensive weapon it has long been obsolete. Compared to a carbine AR you are looking at a heavier, more awkward gun with limited range and ammo capacity. You are also looking at almost 30 ft lbs of recoil vs 4-5 ft lbs for an AR.
In todays military they are occasionally used to guard prisoners, but their primary role is for door breaching. I wouldn't be surprised if I found out that the last time a shotgun was actually fired in the direction of an enemy soldier was during the Vietnam war.