diff --git a/pkg/models/task_search.go b/pkg/models/task_search.go index d4a39197c..07da3f809 100644 --- a/pkg/models/task_search.go +++ b/pkg/models/task_search.go @@ -369,6 +369,7 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo if expandSubtasks { cond = builder.And(cond, builder.Or( builder.IsNull{"task_relations.id"}, + builder.IsNull{"parent_tasks.id"}, builder.Expr("parent_tasks.project_id != tasks.project_id"), )) }