You are right. It varies a lot though by different opioids and dosage plays a major role, too.
Morphine causes more constipation than oxycodone does, for example (not to mention IR vs ER formulations), and in some people morphine causes more sedation and oxycodone might be more stimulant-ish, so they may be opioids / opiates, but they can be significantly different.
That said, constipation can indeed be a major issue, especially in the elderly, but they are most likely are already taking or being given laxatives.
For adults without any GI problems, they can safely be on a better diet and take magnesium citrate before they want to defecate (if they have no kidney issues either). It takes 4-12 hours for magnesium citrate to work. There is an even better form of magnesium, but magnesium citrate should be fine, along with prunes or prune jam, lots of hydration and so forth.
I take opiates for pain, and the way I manage constipation (which is indeed frustrating) is through diet (fibre, prune jam, and so forth) and skipping two days (of the ER formulation) if I have no stool for a few days, along with taking magnesium citrate. I would not recommend taking opiates AND laxatives all the time (or rather, I do not recommend treating OIC with regular consumption of laxatives). Constipation would not be a problem with lower doses and IR formulations though, or much less so.
Just FWIW, if you can pass gass, your bowels are not obstructed, and it is a good sign, so if you take opiates, pay attention to that. If you cannot pass gas and you have abdominal pain, then it can easily become a medical emergency. You should not get to this point though, either by taking less, switching to a different formulation (ER -> IR), or switching to a different opioid, along with a better diet.
Additionally, if you do not take opioids (especially ER ones) on a regular basis (similarly to how some people only take NSAIDs once in a while), then constipation is not going to be an issue at all.
I hope this answers your concerns regarding opioid-induced constipation.