Low potassium will cause slowing of the bowels. It will not lead to painful contractions in any form. Correction by oral supplements is a must.
Since the pain in the said case coincides or has a relationship with menses , the most probable diagnosis is endometriosis
Confirmation of diagnosis followed by commencement of hormonal
treatment in the form of oral contraceptives may be helpful.