API to search within a project ID, for a task that is within a specific additional project

Does anyone have any advice on how to use the API to search within a specific project (based on its ID) to find a specific task?

The task I’m looking for would be within TWO specific projects.

Basically, I want it to return me the task ID of the task that’s within Project X and Project Z.

If the API finds a task (within the project ID I’m looking in) that’s within both of those projects (plus, obviously it’d be within the project I’m looking within), then I want it to return the found Task ID.

It’s extremely unlikely that it’d ever find more than 1 task, but if it did, it could instead just return a string of any found Task IDs.

To sum up:

  1. Search within Project A for a task that is also within both Project X and Project Z
  2. Return the found Task ID(s)

No, I will never know the task’s name, otherwise I’d obviously just search for that. :wink:

Well that was easy: