In this paper we consider the problem of averaging for a class of piecewise deterministic Markov processes (PDMPs) whose dynamic is constrained by the presence of a boundary. On reaching the boundary, the process is forced to jump away from it. We assume that this boundary is attractive for the process in question in the sense that its averaged flow is not tangent to it. Our averaging result relies strongly on the existence of densities for the process, allowing us to study the average number of crossings of a smooth hypersurface by an unconstrained PDMP and to deduce from this study averaging results for constrained PDMPs.