Acute or short-term bronchitis last for days or weeks. It occurs when the bronchial tubes (airways in the lungs) are irritated by a virus, bacteria, or allergen. This causes a cough that produces yellow or greenish mucus.