We present the hybrid hadron string dynamic (HydHSD) model connecting the parton-hadron-string dynamic model (PHSD) and a hydrodynamic model taking into account shear viscosity within the Israel-Stewart approach. The performance of the code is tested on the pion and proton rapidity and transverse mass distributions calculated for Au+Au and Pb+Pb collision at AGS--SPS energies. The influence of the switch time from transport to hydro models, the viscous parameter, and freeze-out time are discussed. Since the applicability of the Israel-Stewart hydrodynamics assumes the perturbative character of the viscous stress tensor, $pi^{mu u}$, which should not exceed the ideal energy-momentum tensor, $T_{rm id}^{mu u}$, hydrodynamical codes usually rescale the shear stress tensor if the inequality $|pi^{mu u}|ll |T_{rm id}^{mu u}|$ is not fulfilled in some sense. We show that the form of the corresponding condition plays an important role in the sensitivity of hydrodynamic calculations to the viscous parameter -- a ratio of the shear viscosity to the entropy density, $eta/s$. It is shown that the constraints used in the vHLLE and MUSIC models give the same results for the observables. With these constraints, the rapidity distributions and transverse momentum spectra are most sensitive to a change of the $eta/s$ ratio. As an alternative, a strict condition is used. We performed global fits the rapidity and transverse mass distribution of pion and protons. It was also found that $eta/s$ as a function of the collision energy monotonically increases from $E_{rm lab}=6A$GeV up to $E_{rm lab}=40A$GeV and saturates for higher SPS energies. We observe that it is difficult to reproduce simultaneously pion and proton rapidity distribution within our model with the present choice of the equation of state without a phase transition.