0

I have been unable to get the :match feature of columnview dblocks to work. I need it because I want to filter headlines by tags that I used to identify Scrum stories in a particular sprint. I have basically tried every conceivable version of :match such as :match "Sprint4", :match "Sprint4", :match ":Sprint4:", :match "TAG=\":Sprint4:\"", and match: "TAG=\"Sprint4\"". Basically, nothing works.

Any ideas on how to get this to work? I am running Org Mode 9.4.5 on Mac OS X Emacs 27.1.

Here is the offending Org mode text

* Scrum Summary
   #+BEGIN: columnview :hlines 3 :id "47B8AC9D-2556-4F6E-AAE1-775731314596" :indent t :maxlevel 4 :match "Sprint4"
   #+TBLNAME: aTable   
   | Status | EPICID | STORYID | TASKID  | Task                     | OWNER | Effort | CLOSED                 | Sprints   |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   |        |        |         |         | Backlog                  |       |     45 |                        |           |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   |        | Epic1  |         |         | \_  Epic on Build It ALL |       |     27 |                        |           |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   | TODO   | Epic1  | Story1  |         | \_    Story 1            |       |     12 |                        | :Sprint4: |
   | TODO   | Epic1  | Story1  | Task1.1 | \_      Task 1.1         | pablo |      7 |                        | :Sprint4: |
   | TODO   | Epic1  | Story1  | Task1.2 | \_      Task 1.2         | john  |      2 |                        | :Sprint4: |
   | TODO   | Epic1  | Story1  | Task1.3 | \_      Task 1.3         | pablo |      3 |                        | :Sprint4: |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   | TODO   | Epic1  | Story2  |         | \_    Story 2            |       |     15 |                        | :Sprint3: |
   | DONE   | Epic1  | Story2  | Task2.1 | \_      Task 2.1         | pablo |      4 | [2020-12-25 Fri 21:20] | :Sprint3: |
   | DONE   | Epic1  | Story2  | Task2.2 | \_      Task 2.2         | pablo |      5 | [2020-12-22 Tue 01:00] | :Sprint3: |
   | DONE   | Epic1  | Story2  | Task2.3 | \_      Task 2.3         | john  |      6 | [2020-12-25 Fri 21:21] | :Sprint3: |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   |        | Epic1  |         |         | \_  Epic to Run          |       |     18 |                        |           |
   |--------+--------+---------+---------+--------------------------+-------+--------+------------------------+-----------|
   | TODO   | Epic1  | Story3  |         | \_    Story 3            |       |     18 |                        |           |
   | TODO   | Epic1  | Story3  | Task3.1 | \_      Task 3.1         | pablo |     10 |                        |           |
   | TODO   | Epic1  | Story3  | Task3.2 | \_      Task 3.2         | pablo |      8 |                        |           |
   #+END:
* Backlog
  :PROPERTIES:
  :COLUMNS:  %TODO(Status) %EPICID %STORYID %TASKID %30ITEM(Task) %OWNER %Effort{+} %CLOSED %Alltags(Sprints)
  :Owner_ALL: pablo john
  :EPICID_ALL: Epic1 Epic2
  :ID:       47B8AC9D-2556-4F6E-AAE1-775731314596
  :END:    
** Epic on Build It ALL
   :PROPERTIES:
   :EPICID:   Epic1
   :END:
*** TODO Story 1                                                    :Sprint4:
    :PROPERTIES:
    :STORYID:  Story1
    :END:
**** TODO Task 1.1
     :PROPERTIES:
     :OWNER:    pablo
     :TASKID:   Task1.1
     :END:
***** [2021-05-08 Sat]
      :PROPERTIES:
      :EFFORT:   3
      :END:
***** [2021-05-08 Sat]
      :PROPERTIES:
      :EFFORT:   4
      :END:
**** TODO Task 1.2
     :PROPERTIES:
     :OWNER:    john
     :EFFORT:   2
     :TASKID:   Task1.2
     :END:
**** TODO Task 1.3
     :PROPERTIES:
     :OWNER:    pablo
     :EFFORT:   3
     :TASKID:   Task1.3
     :END:
*** TODO Story 2                                                    :Sprint3:
    :PROPERTIES:
    :STORYID:  Story2
    :END:
**** DONE Task 2.1
     CLOSED: [2020-12-25 Fri 21:20]
     :PROPERTIES:
     :OWNER:    pablo
     :EFFORT:   4
     :TASKID:   Task2.1
     :END:
**** DONE Task 2.2
     CLOSED: [2020-12-22 Tue 01:00]
     :PROPERTIES:
     :EFFORT:   5
     :TASKID:   Task2.2
     :OWNER:    pablo
     :END:
     :LOGBOOK:
     - State "DONE"       from "TODO"       [2020-12-22 Tue 01:00]
     - State "TODO"       from              [2020-12-20 Sun 19:46]
     :END:
**** DONE Task 2.3
     CLOSED: [2020-12-25 Fri 21:21]
     :PROPERTIES:
     :OWNER:    john
     :EFFORT:   6
     :TASKID:   Task2.3
     :END:
** Epic to Run
   :PROPERTIES:
   :EPICID:   Epic1
   :END:
*** TODO Story 3
    :PROPERTIES:
    :STORYID:  Story3
    :END:
**** TODO Task 3.1
     :PROPERTIES:
     :OWNER:    pablo
     :EFFORT:   10
     :TASKID:   Task3.1
     :END:
     :LOGBOOK:
     - State "TODO"       from              [2020-12-21 Mon 00:08]
     :END:
**** TODO Task 3.2
     :PROPERTIES:
     :TASKID:   Task3.2
     :OWNER:    pablo
     :EFFORT:   8
     :END:
0
0

It's a bug: the code cannot deal with both maxlevel and match set. You get maxlevel if it's set (match is disregarded in that case); you'll only get match if it is set and maxlevel is not set.

Here's a workaround while waiting for the bug fix:

#+BEGIN: columnview :hlines 3 :id "47B8AC9D-2556-4F6E-AAE1-775731314596" :indent t :match "Sprint4+LEVEL<=4"
...

IOW, you just pass a :match argument that incorporates the :maxlevel restriction that you want, without using the :maxlevel argument.

In the meantime, I'll send a patch to the mailing list and we'll see how it goes. For the record, here's my proposed patch:

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 2e1c29a99..7144308ff 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1398,8 +1398,9 @@ other rows.  Each row is a list of fields, as strings, or
                  (org-get-tags))))
         (push (cons (org-reduced-level (org-current-level)) (nreverse row))
           table)))))
-     (or (and maxlevel (format "LEVEL<=%d" maxlevel))
-        (and match match))
+     (if match
+         (concat match (and maxlevel (format "+LEVEL<=%d" maxlevel)))
+       (and maxlevel (format "LEVEL<=%d" maxlevel)))
      (and local 'tree)
      'archive 'comment)
     (org-columns-quit)

EDIT: The bug report and patch is here

EDIT: The patch has been merged into the master branch (see this commit) but has not been merged into the maint branch, so it will not be available until the next major release of Org mode.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.