A "shared" wireless sensor network (WSN) where multiple users deploy multiple tasks requires a mechanism for resource arbitration. This arbitration can be viewed as a problem with determining how best to assign sensors to tasks. The previous approaches only dealt with energy used for sensing; however, experiments have shown that the energy used for communication must be dealt with within the context of a WSN. In this paper, we propose a novel formulation of this problem and a distributed assignment algorithm based on heuristics that takes into account path information between the assigned node and the base station. We take advantage of the "reactive" nature of the system and piggyback path information on task queries. We can expect higher utilization of the network in comparison with previous approaches by preserving routes through which sensing data run. The results of software simulations revealed that our assignment algorithm is more energy-efficient than the previous one that does not exploit information about the path.