Welcome to Healthcaremagic
Thanks for your query
The seriousness of matter depends on your age. If you are an elderly person, it could be a cause of concern. If you are young, it may be related to internal hemorrhoids
(piles) or a fissure which troubles intermittently. Generally fissure also causes pain during passing motion.
A surgeon needs to examine you. You are likely to be benefitted by laxatives, to soften your stools.