π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-8477] fix(api): filter "Updated At" by updated_at column, not created_at (#9514)
Manish Gupta39856932cd6b
diff --git a/apps/api/plane/tests/unit/utils/test_issue_filters.py b/apps/api/plane/tests/unit/utils/test_issue_filters.pynew file mode 100644index 0000000000..ccb9298c52--- /dev/null+++ b/apps/api/plane/tests/unit/utils/test_issue_filters.py@@ -0,0 +1,53 @@+# Copyright (c) 2023-present Plane Software, Inc. and contributors+# SPDX-License-Identifier: AGPL-3.0-only+# See the LICENSE file for details.++import pytest++from plane.utils.issue_filters import filter_updated_at+++class TestFilterUpdatedAt:+ """Regression test for the "Updated At" filter bug β the filter was+ applying to the `created_at` column instead of `updated_at`, so work+ items updated today but created earlier never showed up under+ `Updated At -> is -> today`. See issue #9316."""++ def test_get_method_targets_updated_at_column(self):+ issue_filter = {}+ params = {"updated_at": "2026-06-26"}+ filter_updated_at(params, issue_filter, method="GET")+ # The filter must key on updated_at, not created_at. A bare date goes through+ # date_filter's single-value branch, which appends a lookup suffix+ # (updated_at__date__contains), so match on the prefix rather than the exact key.+ assert any(key.startswith("updated_at__date") for key in issue_filter)+ assert not any("created_at" in key for key in issue_filter)++ def test_get_method_with_csv_targets_updated_at_column(self):+ issue_filter = {}+ params = {"updated_at": "2026-06-25,2026-06-26"}+ filter_updated_at(params, issue_filter, method="GET")+ assert all("updated_at" in key for key in issue_filter)+ assert not any("created_at" in key for key in issue_filter)++ def test_post_method_targets_updated_at_column(self):+ issue_filter = {}+ params = {"updated_at": ["2026-06-26"]}+ filter_updated_at(params, issue_filter, method="POST")+ assert all("updated_at" in key for key in issue_filter)+ assert not any("created_at" in key for key in issue_filter)++ def test_get_method_with_prefix_targets_updated_at_column(self):+ issue_filter = {}+ params = {"updated_at": "2026-06-26"}+ filter_updated_at(params, issue_filter, method="GET", prefix="cycle_issue__")+ keys = list(issue_filter)+ assert any("cycle_issue__updated_at" in k for k in keys)+ assert not any("created_at" in k for k in keys)++ def test_empty_get_filter_is_noop(self):+ issue_filter = {}+ params = {"updated_at": ""}+ filter_updated_at(params, issue_filter, method="GET")+ assert issue_filter == {}diff --git a/apps/api/plane/utils/issue_filters.py b/apps/api/plane/utils/issue_filters.pyindex ea31a529bb..3669d8a1ad 100644--- a/apps/api/plane/utils/issue_filters.py+++ b/apps/api/plane/utils/issue_filters.py@@ -231,14 +231,14 @@ def filter_updated_at(params, issue_filter, method, prefix=""):if len(updated_ats) and "" not in updated_ats:date_filter(issue_filter=issue_filter,- date_term=f"{prefix}created_at__date",+ date_term=f"{prefix}updated_at__date",queries=updated_ats,)else:if params.get("updated_at", None) and len(params.get("updated_at")):date_filter(issue_filter=issue_filter,- date_term=f"{prefix}created_at__date",+ date_term=f"{prefix}updated_at__date",queries=params.get("updated_at", []),)return issue_filter