How I Semi-Automated Work Tracking in Jira
This is a great area to explore because I believe no one enjoys creating work log records in Jira.
Nowadays, many companies offer developers a high degree of flexibility in their workflow, making it essential to have precise information about what every team member is doing. While many of us are returning to the office, others work in a hybrid mode, and it has become a common practice to require detailed time tracking in systems like Jira.
💡 Those of us who have worked in outsourcing and outstaffing companies and projects know how meticulous they are when it comes to tracking your activity.
In my current company I’m obliged to create work log records daily in my employee Jira server. This process is checked from time to time by management side. According to the existing flow, I’m required to log my activity every evening with some details in a single Jira task. Later this data is used for creating some reports.
I strongly believe that this is a valid requirement from the company side, however, it sometimes slips our minds.
Additionally, it’s quite frustrating to recall everything you did during the day each evening.
💡Joy of automation
What really makes me happy is the creation of tools that can reduce the number of routine operations.
Having considered all points mentioned above I decided to implement a small tool that can be used to simplify the creation of work logs on my current project. What is the most suitable format for the tool? It’s obvious that for developers, the most straightforward solution is a command line application. For instance, I keep terminal opened literally all times since I work primary as a full-stack engineer. As a delivery option I chose to distribute it as an NPM package because:
- it’s easy to maintain versions of the application
- the source is well-known so users can be sure in the origin of the application
The flow I thought about was "Hey, you did something? Write this in terminal!"
. Additionally, in line with my company’s internal procedures, all work log records must be created under the same ticket each day.
Before implementation was started, I planned to cut the following set of corners:
- Eliminate the need to recall what you have done during the day
- Remove the necessity to navigate to the Jira website
- Avoid the requirement to authenticate in the web version of Jira
- Automate work log entries creation based on
git
activity - Provide templates for common activities
What I have now
Were goals achieved? Well, yes they were.
As it was planned, I’ve created an NPM package jiralog which is available
to everyone.
For sure, this is still a prototype but it
can be used already and it is actually used
!
Let’s say a new user wants to give it a try. Two prerequisites are having Node.js and NPM installed locally.
The following step is actual installation of the application with npm install jiralog -g
.
After installation you need to run jira config
and provide required information to prepare a basement for further
jira magic.
Basically, that’s it! Now you can work with jira
command directly from your terminal. Although all available
commands are given in the readme a small demo of usage can be given below:
jira j daily
jira j planning
jira log 0.5 "Had a call with PM and LD in order to allign solution for bug #3201-1"
jira log 4 "Worked on resolution of #3201-1"
jira git
jira log 0.5 "Assisted Bob with refactiong of Notification package"
jira log 0.5 "Conducted peer-review for Kate #3198-4"
jira post
Let’s go though commands one by one and check what they are used for.
💡This is still a prototype
The application is created partially for fun and partially for personal usage in the scope of one of my projects. This means that some functions are coupled to that context. In other words, contributions and suggestions are welcomed
jira j
command is a multifunctional command which can be considered as an entry point for your actions. It can be
used to create a work log record based on existing template or launch git activity wizard. By the way, you can
manage your templates with jira template
command.
jira log
command is used to create an activity record with defined duration and description.
jira git
command is used to launch a special wizard for git activity analysis. During initial configuration user
is asked to provide a path to folder with repositories that are being actively contributed. With jira git
you can
create a work log record based on your today’s commits. That would be great if you follow conventional commits
standard (Which I believe all of us should follow 😊) because in
this case the application will get task number from the commit message.
jira post
command is used to post the created work log records to the Jira server.
It’s worth mentioning, that you can post your activity for a day that differs from today (Like this). Additionally,
you
can
provide a custom format for activity log message with jira format
command.
On the next day you can use jira yesterday
during the daily stand-up call to get a short summary about your recent
activities.
Summary
A small CLI tool has been created to put some developers at ease in relation to tracking their daily activity. It’s available now, it’s used in the team and can make our lives a bit more convenient.
💡 I believe the best place for automation is in the tasks we perform daily right at our work desks.