Forum Academy Marketplace Showcase Pricing Features

How to register time spent on a task? Project management tool - Need Help :)

Hello to everyone

I am writing to you because I am facing a problem that I have not been able to solve for almost a day.

I am currently working on a simple project management application, where users can create “projects” and assign “users” to them. In these projects users can create “tasks” and assign other users to them.

For information I have taken Gregory John’s Udemy course “The bubble beginners bootcamp”.

What I would like to add is the possibility for each user assigned to a task to fill in the number of hours spent on it. This would allow to display the total number of hours spent by the team on a “project dashboard”.

The problem is that I can’t figure out the best way to do this.

So far I’ve thought of:

  • Adding an “Hours” field (which is a list of numbers) to the “Task” data type. With the :sum function this allows to calculate the total time spent on the task (and by extension on the project). The disadvantage is that it is not possible with this method to filter which user enters which number of hours for the task. Moreover, there is nothing to prevent the same user to enter several number of hours in the list.

OR

  • Create a timesheet for each user and each task. Concretely: create a data type “Timesheet” with the following fields: task, assignee (which contain a unique user assigned to the task → “current user”), hours. This method allows to know exactly which user has spent how many hours on each task. However, this complicates the process enormously because there should only be one timesheet per user and per task…

I think I’m overcomplicating the problem, but I can’t think of a simpler solution. The main difficulty comes from the fact that several users can be assigned to the same task (the data type “task” contains a field “assignees” corresponding to a “list of users”).

Do you have any ideas or tips on how to do this? It would help me a lot!

Thanks in advance and have a nice day :slight_smile:

Hi there, @bootstrapperideas… one thought that comes to mind is to have an Assignment data type that links a task to a specific user, and you could put the hours field on that data type. So, a single task could be part of multiple things in the Assignment data type, and each one of those things only has one user and one value for the number of hours spent.

Anyway, just food for thought, and I hope it helps.

Best…
Mike

Hi @mikeloc,

Thank you for the thought!

In the end I made a mix between what you proposed and my “timesheet” solution.

I write here my method, it could be useful to people who want to do the same thing :slight_smile:

To summarize, each member of the application has a unique timesheet for each project, allowing him to enter his time spent and his price.

It can be improved, but for the moment each time an assignee enters his time spent on a project :

  • We check that a timesheet with the input “assignee = current user” and “project = current project” does not already exist

  • If not: this creates a new timesheet with input “assignee = current user” and “project = the state of the page which is the name of the current project”, then we modify the input “Hours” of the timesheet with the value of the input allowing to fill in its time spent.

  • If yes: we update the “Hours” input of the pre-existing timesheet.

1 Like