Searching for stale tasks, no updates in 5 days

Hello,
We are trying this filter:
status:open modified:<"-5 days"
to find tasks that haven’t had any modification in the last 5 days. It seems to work, except it doesn’t detect comments as modifications. For us, putting a comment is a modification (a status update).

Does anyone have any suggestion? How can we filter for tasks that have had no comment and no update in the last 5 days?

Thanks!

1 Like

either create a custom filter to address it, or override the comment controller to also update the taskmodel modification date when comments are added or modified.

the first would be the simplest. might be as simple as just adding a date filter to comments and then using both filters, i.e. status:open modified:<"-5 days" comment_modified:<"-5 days"

with your custom filter looking something like:

class CommentModificationDateFilter extends BaseDateFilter implements FilterInterface
{
    /**
     * Get search attribute
     */
    public function getAttributes()
    {
        return array('comment_modified');
    }
    /**
     * Apply filter
     */
    public function apply()
    {
        $this->applyDateFilter(CommentModel::TABLE.'.date_modification');
        return $this;
    }
}

if you wanted to combine, something like this in the apply: (although I have a feeling it’s not this simple)

$this->query->beginOr()
        ->applyDateFilter(CommentModel::TABLE.'.date_modification');
        ->applyDateFilter(TaskModel::TABLE.'.date_modification');
        ->closeOr();

return $this;
1 Like

This was discussed in issue #2978 which is now closed and unsolved, unfortunately.

I agree with you that any addition of comments (and links, files, etc.) should be considered as a modification…

so make an action that does what you need.

for your reference, here is an action that detects if a new comment has been added to a task, and then sends an email notification.

now you just need to figure out how to make it update the task modification date instead.

here’s a hint:

$values = array(
            'id' => $data['task']['id'],
            'date_modification' => time(),
        );

        $this->taskModificationModel->update($values, false);

Nice suggestion! The problem is… i’m not coding, just trying to disseminate kanboard, and the kanban way of working, in my job :slight_smile:

when my toilet line breaks, I have problems as well, but I hire a plumber, and the problem goes away.

1 Like