Comets in the Oort cloud evolve under the influence of internal and external perturbations, such as giant planets, stellar passages, and the galactic tidal field. We aim to study the dynamical evolution of the comets in the Oort cloud, accounting for external perturbations (passing stars and the galactic tide). We first construct an analytical model of stellar encounters. We find that individual perturbations do not modify the dynamics of the comets in the cloud unless very close (< 0.5pc) encounters occur. Using proper motions, parallaxes, and radial velocities from Gaia DR2, we construct an astrometric catalogue of 14,659 stars that are within 50pc from the Sun. For all these stars we calculate the time and the closest distance to the Sun. We find that the cumulative effect of relatively distant ($leq1$ pc) passing stars can perturb the comets in the Oort cloud. Finally, we study the dynamical evolution of the comets in the Oort cloud under the influence of multiple stellar encounters within 2.5pc from the Sun and the galactic tidal field over $pm10$Myr. We considered two models for the Oort cloud, compact (a $leq$0.25 pc) and extended (a$ leq0.5$ pc). We find that the cumulative effect of stellar encounters is the major perturber of the Oort cloud for a compact configuration while for the extended, the galactic tide is the major perturber. In both cases, the effect of passing stars and the galactic tide raises the semi-major axis of $sim1.1$% of the comets at the edge of the cloud up to interstellar regions ($a >0.5$pc). This leads to the creation of transitional interstellar comets, which might become interstellar objects due to external perturbations. This raises the question about the existence of a cloud of objects in the interstellar space which might overlap with our Oort cloud if we consider that other planetary systems face similar processes for the ejection of comets.