Strategery-Inc / jira-harvest-time-tracker

Track time in Harvest directly from your JIRA issues!
12 stars 0 forks source link

WorkLog is not updated in JIRA if timer stopped from outside the issue. #91

Closed summin closed 5 years ago

summin commented 5 years ago

Dear Strategery Inc

After one of the updates of the jira-harvest-time-tracker we have noticed that the following problem occurs. If we start using timer in one of the issues, it is working spotlessly and when we press Stop And Log, it stops and logs the time in jira. However, if the timer is running on one of the issues and then we start the timer in another issue, the timer on the original issue stops, but does not log the time in jira.

Steps to reproduce the behavior:

  1. Go to 'any issue X'
  2. Click on 'start timer'
  3. Keep the timer running in that issue.
  4. Go to another issue Y and start timer there.
  5. Go back to issue X and refresh the page.
  6. What we see is that the timer stopped, but the work was not logged.

The WorlLog in the Issue X is also not updated if we stop the timer from Harvest. However, if the timer is stopped in the issue X Addon window, then the work is logged.

Expected behavior We expect the time to be logged in the issue Y after the timer stops automatically.

Please complete the following information:

We would appreciate any input on this issue and*or how to fix it.

Best Regards, Aleksandr.

shernandez-ctrlQS commented 5 years ago

Hi @gsomoza,

It would be cool to know if this is a accepted issue for you and it will be looked into, thanks.

Best regards, Sergio

gsomoza commented 5 years ago

Hi Aleksandr and Sergio. The plugin only works when time is tracked through the plugin. It's impossible for us to know when a timer is stopped outside of the context of the plugin, because Harvest doesn't provide integration features that would allow that. In other words: this is a known limitation.

I'll close this ticket and add it to the FAQ page in the wiki, but we can still continue the discussion if you want.

shernandez-ctrlQS commented 5 years ago

Hi @gsomoza, The actual issue is not the connection Harvest -> plug-in, but it is that starting the timer via the plug-in in a second ticket does´t log the time in the first Jira ticket, where the timer was previous started but not stopped manually. So: 1- timer is started in ticket A 2- later the timer is started in ticket B This results in time has been logged into Harvest for ticket A but not in the Jira ticket itself. We expect that time is logged in Harvest and Jira for the ticket A. Let me know if this is still not clear, thanks again. Best, Sergio

gsomoza commented 5 years ago

Oh, I understand now. That's also a limitation with the Harvest API: we can't reliably determine where the current timer is running. So if you switch to a different JIRA ticket without stopping the timer, on the new page there's no way for us to know if a timer is running elsewhere.

We could fix it by using cookies or local storage to indicate the last time entry with a running timer. But that would only work for timers started through the system. And it would get messy if you have several JIRA tabs open. The only real solution to both of these issues (this one, and the one I first answered to) would be that Harvest improves features in their API to provide webhooks and other utility functions such as "last timer running".

We've had these issues with their API for many years and they still didn't fix them, so I'd imagine this either isn't important for them or they have limitations on their platform that make them hard to implement. Either way, the effort we'd have to make on our end to "work around" those issues is too big for a simple plugin like ours – especially if we stick to our goal of being 100% "serverless".

shernandez-ctrlQS commented 5 years ago

Thanks, @gsomoza, this answer makes sense now :-)