THe last time Teddy did that he needed his anal glands cleaned out. It only took the vet a minute to do it, but it was gross
I also did karo syrup and pumpkin when he was little and constipated, he loved them both, just make sure the canned pumpkin is pure pumpkin and not the pumpkin pie mix.
Good luck!