Skip to content

[Bug]: timeEstimateCategory condition doesn't account for the null value that is the default on task creation. #1386

@osxisl

Description

@osxisl

Bug Description

When I create a task, it doesn't have the timeEstimate property.
Expected behavior: timeEstimateCategory shows "No estimate" on kanban task card.
Actual behavior: timeEstimateCategory shows "Long (>2h)" on kanban task card.

Image

Not sure if the condition should be fixed or default value for the timeEstimate property on task creation.
But changing the condition from:
if(!timeEstimate || timeEstimate == 0, "No estimate", if(timeEstimate < 30, "Quick (<30m)", if(timeEstimate <= 120, "Medium (30m-2h)", "Long (>2h)")))
to:
if(!timeEstimate || timeEstimate == 0 || timeEstimate == null, "No estimate", if(timeEstimate < 30, "Quick (<30m)", if(timeEstimate <= 120, "Medium (30m-2h)", "Long (>2h)")))
solves the issue for me.

Image

It looks like fix might be pretty easy here:
to update these two lines:

timeEstimateCategory: `if(!${timeEstimateProperty} || ${timeEstimateProperty} == 0, "No estimate", if(${timeEstimateProperty} < 30, "Quick (<30m)", if(${timeEstimateProperty} <= 120, "Medium (30m-2h)", "Long (>2h)")))`,

| `timeEstimateCategory` | Task size by time estimate | "No estimate", "Quick (<30m)", "Medium (30m-2h)", "Long (>2h)" | `if(!timeEstimate \|\| timeEstimate == 0, "No estimate", if(timeEstimate < 30, "Quick (<30m)", if(timeEstimate <= 120, "Medium (30m-2h)", "Long (>2h)")))` |

@callumalpass I might try to create a PR with the changes needed, though I never did that on public repositories, so not sure how to do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions