The optimal control is considered for distributed parameter stochastic systems with random jumps. The control is allowed to enter into both diffusion and jump terms, and a fairly general end constraint is taken into consideration. Under the assumption of a finite-codimension condition, which is always satisfied when the state space is of finite dimension, a maximum principle is proved for the optimal control. When calculating the variation of the cost, we use the vector-valued measure theory. As a matter of fact, we use only the scalar case of this theory, although the optimal control problem involves infinite-dimensional state space. The study unifies the Pontryagin-type maximum principle for continuous, discontinuous, deterministic, stochastic, finite-dimensional, and infinite-dimensional optimal controls.