Parent or child tasks from maniphest.search

With conduit[maniphest.search] I can successfully find all tasks that are children of another list of tasks by using the parentIDs constraint in a single query. However, the returned array of tasks does not include any indicator of which parent each belongs to.
How can I find this info for a set of parent tasks without submitting a separate query for each one?
Or is it possible to add parentID or childrenIDs to the results of any other maniphest.search? This would allow me to do the same thing (with some extra work). Perhaps as a specified attachment.
FYI - I am working with a python client.
Thanks

Use edge.search with sourcePHIDs as the list of parent PHIDs and types as ["task.subtask"].

This isn’t a great fit as an attachment because the list may be arbitrarily long, and we’ve seen some cases where tasks have hundreds or thousands of subtasks. Usually the use cases leading to this are fairly questionable, but our options are roughly:

  • provide the information via a pageable API;
  • add some kind of hard limit on subtasks; or
  • sometimes the API just doesn’t work.

And “pageable API” is broadly the least bad.

OK, I have that working. It’s a pity it only returns the basic source/dest info for the request (rather than full task info) but I can get that through another query.

Thanks very much.

FYI - I was surprised to find that this returns ALL the subtasks (the whole tree) rather than just the immediate subtasks. I can work with that but is there a way to control or limit that behaviour?

I can’t reproduce this. I created “Task A” with child “Task B” and grandchild “Task C”:

When querying for task.subtask edges of “Task A”, only “Task B” is returned:

How odd. I definitely see the grandchild. I will retest and try to send an example result so we can compare scenarios.

Apologies. This was my mistake. I was putting the parent and first level child into the edge query so was also seeing the grandchild in the result.
Thanks for checking this out.