[SOLVED] How do you get from a commit to a task via conduit?


If I have a commit such as https://secure.phabricator.com/rP98cac2cc2994d4584678c3be79f6f32b2965d2fb I can manually go to https://secure.phabricator.com/D19196 and then to https://secure.phabricator.com/T13101 . How do I do the same via conduit (assuming I only know the commit hash originally)?


Pass the hash to diffusion.commit.search to find the commit PHID.

Pass the commit PHID to edge.search to find related revisions (using commit.revision).

Pass the revision PHIDs to edge.search to find related tasks (using revision.task).

You can likely combine steps (2) and (3) by searching for the commit.task relationship instead, but note that “tasks related to commit X” and “tasks related to revisions related to commit X” may be different sets. The most common reason that these sets are different is that someone has used the UI to edit some of these relationships after the commit was published.


Ah wow, I hadn’t seen edge.search before and thanks for the warning about how the relationship might not be transitive…

closed #4