Topic on Talk:Phabricator/Help

Query multiple columns via Maniphest

5
MBinder (WMF) (talkcontribs)

I would like to see if a task matches criteria for more than one column (obviously on different boards, assuming columns on the same board are mutually exclusive). I tried doing that here: https://phabricator.wikimedia.org/maniphest/query/ElPvD_Yiivyc/#R

but it seems to either A) show me everything in both columns combined (rather than only tasks that match both columns), or B) show me something else entirely. I am thinking this is because I lack a way to say "and" rather than "or" (the latter accomplished, I think, via comma separation), or the query is simply breaking something.


Is there a way to query via Maniphest that says "show me tasks that exist in both of these columns"?

AKlapper (WMF) (talkcontribs)

I've never seen the "Columns" field on Maniphest's Advanced Search form. How to get that displayed? :)

There seems to be no logical AND or OR for entries in the "Columns" field, indeed. No good idea (so far).

I wondered if explicitly adding the corresponding projects of those columns into the "Tags" field ("Ready for Development" on #iOS-app-v6.8.1-Manta-Ray-On-A-Tractor, "Bug Backlog" on #Wikipedia-iOS-App-Backlog), as the "Tags" field by default is a logical AND. But https://phabricator.wikimedia.org/maniphest/query/m_oBmrmGYCuz/#R does not work as expected either (some results are incorrect).

MBinder (WMF) (talkcontribs)

> I've never seen the "Columns" field on Maniphest's Advanced Search form. How to get that displayed? :)

I generated that via "View tasks as query" in the per-column menu (the non-intuitive pencil icon).

Thanks for taking a try with your query. It's curious how those results generate, given (as you said) that they are seemingly wrong.

Is there documentation somewhere for Maniphest syntax? Could I imply "and" via "+" or something, etc?

AKlapper (WMF) (talkcontribs)

I guess the "Columns" field (which is not exposed by default) does not support multiple values at all and only parses the first value, but that's just my guess based on the results of the two queries above. Might be a question for upstream at https://discourse.phabricator-community.org/ .

For the records only, the corresponding SQL query for what is wanted here would be something like this (and currently shows 3 task results):

SELECT t.id FROM phabricator_maniphest.maniphest_task t INNER JOIN phabricator_project.project_columnposition cp INNER JOIN phabricator_project.project_column c WHERE c.phid = "PHID-PCOL-csnseb4iqcjdwssg7r7k" AND c.phid = cp.columnPHID AND t.phid = cp.objectPHID AND (t.status="open" OR t.status="stalled") AND t.id IN (SELECT t.id FROM phabricator_maniphest.maniphest_task t INNER JOIN phabricator_project.project_columnposition cp INNER JOIN phabricator_project.project_column c WHERE c.phid = "PHID-PCOL-qvpchgb7ecjhwhdeyuzv" AND c.phid = cp.columnPHID AND t.phid = cp.objectPHID AND (t.status="open" OR t.status="stalled")) ORDER BY t.id;

MModell (WMF) (talkcontribs)

From looking at the code, it seems that the columns search field indeed supports multiple phid values and does an OR not AND on the columns. I don't see any way to do the intersection of two or more columns, only the union is possible.

Reply to "Query multiple columns via Maniphest"