We derive the optimal investment decision in a project where both demand and investment cost are stochastic processes, eventually subject to shocks. We extend the approach used in Dixit and Pindyck (1994) to deal with two sources of uncertainty and we assume that the underlying processes are jump diffusion processes. Assuming certain conditions on the parameters, we are able to derive a closed expression for the value of the firm. Finally, we present comparative statics for the investment threshold with respect to the relevant parameters.