I get them also. I think is is common with UC flairs. The NIH website has a term for it. "Tenesmus involves constantly feeling the need to empty the bowels, along with pain, cramping, and straining." Be glad that yours end quickly. In my case they last for hours. Severe pain at first followed by a dull pain that last for a few hours. I just learn to live with it.
Diagnosed with UC in 2005
Colazol 3 x 3 daily
Fish oil Capsules 1 with each meal
2005 to 2009 condition manageable with minor flare-ups
2010 more severe flare-ups