According to Michael Murray in his book, The Encyclopedia of Healing Foods, constipation is most often caused by a low-fiber diet. It has also been established that inadequate fluid intake can be problematic when it comes to constipation.
So, since cranberries have a certain amount of fiber in them and cranberry juice can help to hydrate your body then yes, cranberry juice could help relieve constipation. However, the best relief for constipation will come from plain water. Even if you have plenty of fiber in your diet, if you don't have enough water to soften and bulk the stools, you will remain blocked. Aim to drink the equivalent in ounces of half your body weight. So, someone who weighs 150 pounds would aim to drink 75 ounces of water per day.
Some other remedies of constipation also include exercise, probiotics, warm beverages and more.