If you are using JIRA to log your working hours I think the best policy is to write it right after you are done with particular task. In the process I’ve experienced a couple of non-happy-path-scenarios such as:
JIRA is down
JIRA is slow (I am complicated about speed, kinda like Corey Haines)
In order to mitigate that, I’ve started writing notes to .txt file. I would then type-in all hours at the end of the day. It’s just me and my beloved Vim. What could go wrong? Right?
Well, it sounded better in theory as it had its own share of problems, such as:
Keeping the file open all day long (and more so finding it)
Forcing myself to fiddle with JIRA for x tasks (not to mention “at the end of the day” part)
Command Line To The Rescue
At the end I’ve settled with using command line for logging work to intermediate “send” file (instantaneous) and than at the end of the day sending the whole batch to JIRA via API.
rake log:work[1,1h,'Really ground breaking work']
rake log:work[1,2h,'Best thing since sliced bread']
rake log:work[1,3h,'Finding missing semicolon']
rake log:work[OTHERPROJ-1,2h,'Figuring out how to send parms via Rake :)']
Rake is a bit moody as interface. You need to watch out not to use comma except as a token delimiter. (For example I didn’t find the way to use it in comment). And it’s super sensitive to spaces so I tend not to write them.
My language of choice was Ruby, and for interface I’ve used Rake. Mostly because that way I can add recurring tasks to rake (such as holidays…) and I can list all my tasks for free with:
The code is not all that important as I had much more trouble finding the optimal workflow. Nevertheless I’ll put the code below in hope that someone will find it useful:
require'rake'require_relative'log_work'require_relative'jira'namespace:logdodesc'Add worklog to JIRA'task:work,[:task_key,:time_spent,:comment,:go_back_in_days]do|t,args|args.with_defaults(:go_back_in_days=>0)task_key=args[:task_key]task_key=task_key.to_iiftask_key=~/^[0-9]+$/LogWork.add_work(task_key,args[:time_spent],args[:comment],args[:go_back_in_days].to_i)enddesc'Send all worklogs to JIRA'task:senddoLogWork.send_all(Jira)endend