Thank you for putting up your problem to Healcare Magic!
Heart burn and intermittent crampy pain of boring type is suggestive of Acid peptic disease- APD.
Pain comes and goes according to type of food some times spicy and at irregular times causing the problem while regular diets keeping you symptom free.
You can visit your physician for the treatment.
Alternatively you can start OTC Ranitidine
150 BD before meals, about 1hour before major meals, for one and a half month duration.
It will resolve your problem.
I hope this information would be both informative and helpful for