The current paper focuses on the analysis of transient cavitating flow in pressurised polyethylene pipes, which are characterized by viscoelastic rheological behaviour. A hydraulic transient solver that describes fluid transients in plastic pipes has been developed. This solver incorporates the description of dynamic effects related to the energy dissipation (unsteady friction), the rheological mechanical behaviour of the viscoelastic pipe and the cavitating pipe flow. The Discrete Vapour Cavity Model (DVCM) and the Discrete Gas Cavity Model (DGCM) have been used to describe transient cavitating flow. Such models assume that discrete air cavities are formed in fixed sections of the pipeline and consider a constant wave speed in pipe reaches between these cavities. The cavity dimension (and pressure) is allowed to grow and collapse according to the mass conservation principle. An extensive experimental programme has been carried out in an experimental set-up composed of high-density polyethylene (HDPE) pipes, assembled at Instituto Superior Técnico of Lisbon, Portugal. The experimental facility is composed of a single pipeline with a total length of 203 m and inner diameter of 44 mm. The creep function of HDPE pipes was determined by using an inverse model based on transient pressure data collected during experimental runs without cavitating flow. Transient tests were carried out by the fast closure of the ball valves located at downstream end of the pipeline for the non-cavitating flow and at upstream for the cavitating flow. Once the rheological behaviour of HDPE pipes were known, computational simulations have been run in order to describe the hydraulic behaviour of the system for the cavitating pipe flow. The calibrated transient solver is capable of accurately describing the attenuation, dispersion and shape of observed transient pressures. The effects related to the viscoelasticity of HDPE pipes and to the occurrence of vapour pressures during the transient event are discussed.