I’m constantly looking for ways to improve my setup, and one nagging issue I’ve had is counting up the total quantity of beers I have scattered throughout the basement. I have a quantity custom field on each beer, but the field is not summable using JQL. I had to come up with something else.
Time To Think
I knew I needed a way to get a summable field onto each beer (issue.) I thought about using some workflow triggers to add or subtract from a value as each beer goes through the workflow. This was overly complicated and would have been far more work than it was worth. I wanted this to be simple.
I looked through the Atlassian Marketplace to see if there were any summable custom fields I could install in my environment. There were a couple options, but most were either only available for self-hosted environments, or they were prohibitively expensive for this use-case.
There had to be another way.
On The Right Track
After putting the problem aside for a bit, a solution finally came to me while I was at work. I was setting up a new filter to keep track of the hours logged for a new client, and I was using the filter for a dashboard gadget that would sum up the total.
This was it. I could use JIRA Time Tracking to track the quantity of each beer, and sum that quantity using the built-in Time Tracking functions.
I needed to change some time tracking settings to get this working. Since this is my personal environment, it was simple to change what I needed. This is a global change however, so if you do this be aware that it will affect all projects that use Time Tracking.
I decided that each unit of beer would equal 1 day when logging work. I set the “Hours per day” to 1 and the “Days per week” to 7. This way there would be no real way for me to log less than one beer at a time. I changed the format to “days” since I won’t be dealing in values other than whole days, and I made the Default Unit “day” so that, from the Log Work screen, I could just type the number without the unit (m,h,d).
Next, I setup a filter to find all issues in the project BEER that did not have any time logged against it.
Unfortunately, “Work Logged” is not a field that can be set using the Bulk Change Tool, so I would have to set this manually. I already had quantity defined through the custom field on each issue, so this was just a matter of working through each indiviual issue and logging work to match the quantity that was already set. This was made tremendously easy using the Operations dialog box:
To access the Opertaions dialog box, just press period (.) in any JIRA window, and you will be presented with a searchable list of any action you can run on an issue. Using this to log work and then move to the next issue in my filter list made it so I never had to leave the keyboard while doing the initital time-logging for all of the existing beers.
Despite how great the Operations dialog box is, it still took awhile for the intial data-load. In an effort to speed things up, I may have depleted some inventory in the process.
After all was said and done, I was left with beers fully popualted with Time Tracking data:
Summing Things Up
Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn’t stop to think if they should.
Dr. Ian Malcolm, Jurassic Park
This quote kept popping into my head as I was logging work on each issue. Now I was at the point of no return. I had to come to terms with the size of the collection. Maybe I would have been better off not knowing how much beer I had down in the basement. Ignorance is bliss, right?
I couldn’t stop now.
I chose to use the “Workload Pie Chart” gadget, so that I could see a breakdown of how much of each style of beer I had. A well-balanced collection is a happy collection.
As you can see, the current total is 161 beers, the overwhelming majority of which are Stouts. I expected that. What I did not expect was the disappointing lack of sour beers from the Pie Chart. There are so few that they have been relegated to the “Other” slice. I guess I just drink them too quickly.
All-in-all I am pretty satisfied with this solution. I was able to get this working without too much over-complication and without having to use any overhead associated with add-ons or extensive customizations. The only downside is having to make sure that I record both quantity and time spent when creating new beers in the system, but I can make that pretty easy through workflow transition screens.
Time to go log some work!