The Shotgun is good when you know your enemy's health is low and you are close enough to them. Outside of close range, your Shotgun is completely useless.
If you're brave enough get close to any enemy and Grapple them with the alt-fire button. All bots except the Jack Bot XL will be destroyed in one hit. For Pros, if their health is full they will still be alive, but the grapple finishes with them right in front of your shotgun, so quickly follow up with some lead to the gut to finish them off!
Another way to use the Shotgun effectively is sneak up on an enemy. If you can get close to Snipers, you can easily blast them away, and with some careful aiming, a Tank or Gunner can be taken out without too much fuss.
The Shotgun is very deadly on the lighter Pros like the Sniper, and the Assassin. It will most of the time kill them in 2 to 3 hits if they have any armor endorsements on. Don't try to fight a Tank or Gunner one-to-one unless you have a Gold or Silver Armor or Fire Rate endorsement, let your teammates take care of them unless they are low on health.
The Shotgun can destroy a Slimbot in one shot. However, due to it's short range, it's not too useful against bots, so it's advised that you either use your Heal/Hurt gun for longer range and to offset the damage from the robots lazers, let your team mates take care of them, air strike them, or use turrets and firebases.
Use the Shotgun on cloaked Assassins because the Heal/Hurt Gun is useless on them when they are cloaked.
The Shotgun is a good weapon to use while counter-juicing, as it does way more damage-per-shot then any of the other Pro's weapons in the game and can disperse a juiced player easily and save your base.