We can get internal muscle spasms along the intestine which are pretty painful, and antispasmatics like bentyl can treat them.
Is this pain associated at all with pooping, that is occurs before, during or after poops? Or does this pain occur randomly during the day with no association with pooping? Peri-anal complications of IBD (hemis, fissures, or abscesses) are more common to be while you're pooping and/or while sitting. Spasms are more prone to be randomly throughout the day without any association with pooping.
On a scale of 1 to 10 (with 10 being call me an ambulance ASAP), how bad is the pain? Various gas pains and trapped stool pains are on the very milder end of the scale.
More info on Peri-anal complications (most often associated with Crohn's but can occur to UC patients as well):
https://www.ncbi.nlm.nih.gov/pmc/articles/pmc2780223/