How to find all open tasks from which a certain project was removed?

I need to find all Maniphest tasks which at one point had a certain Project tag but for which the Project tag was removed again.

These Maniphest tasks show in their history on the web an entry like

User edited projects, added SomeProject; removed OtherProject. Date Time

or similar (not all had another project added simultaneously), some had multiple projects removed simultaneously.

I know I could manually open all open tasks in the browser and search for text “removed OtherProject” on each web page. I would rather use the built-in query to achieve this but I do not find how to search for Projects that have been removed.

There’s no straightforward builtin way to do this from the web UI today.

In recent versions of Phabricator (roughly since https://secure.phabricator.com/D20531 in late May), you can go to “Feed > Transaction Logs”, search for “Object Types: Maniphest Task”, and get a pageable list of human-readable stories about all edits to all tasks. You could use browser search to look through this as a slightly better alternative to browser searching each task, but it’s still very cumbersome. You can export this list to Excel/CSV/JSON and search through it there, which is perhaps slightly better.

Via the API, you can use transaction.search via the API to retrieve a list of transactions for an object, and since roughly https://secure.phabricator.com/D20209 (late February) this has included details about project changes. This API only operates on one object at a time, but you could write a script to enumerate objects using maniphest.search, then iterate over them and use transaction.search to find project changes. This will get you exactly what you want in a repeatable way, but require some upfront investment in writing a script to query the API.

Upcoming changes to Facts (see https://secure.phabricator.com/T13279) may provide a more direct way to access this information via the web UI, but no ETA on that or guarantees it will actually be available.

1 Like

Thanks, this helped a lot. I have used the transaction logs method, saved to csv, and then could use grep and cut to extract the relevant tasks.