Jira Email Summarizer

I’ve written a Python program to do something fancy with JIRA that I couldn’t get using built-in facilities. You already get notifications from Jira about the tickets you personally care about, based on your notification settings. My tool will give you, additionally, an hourly email in your inbox summarizing all the changes in projects you care about, skipping the the ones you already got direct notifications of. Not only that, but it will make sure that you only ever have one of these summaries in your inbox, by consolidating them when a new summary is generated. It’s only at version 0.2 at the moment, but I’m opening it up today and hopefully some of you will find it useful. Over time, I hope we can polish it some more.

The Motivation

I get Jira notices all day long (at least 300 per day), for a variety of projects. Sometimes I’m in a situation where I want to review and potentially act on these notifications immediately. At other times I take a hiatus from email and focus on meetings, coding, etc., and all those notifications pile up (I’ve written another, more complicated tool to handle these, which I’ll cover later).

When I go from a task back to email mode, and review the ruin that time has wrought on my inbox, one of the things I scan for is the latest Jira developments. However, even with my ticket mail notification pruning tool, the signal to noise ratio was not good enough. Plus, I still had to review each update, email by email.

To Hell With Filters

So why not just do the obvious thing and use filters? Well, I’ve tried filters many many times. The problem is, once I filter something, it’s not in my inbox any more. I have so much other mail piling up in my inbox that I never go looking into the filter folders. So filtered mail is just forever dead to me. In some cases that’s actually just fine, and if there’s something I’ve never read but then need to find, I can search for it. With Jira tickets, however, that isn’t sufficient – I have to stay on top of those.

I looked for a Jira plugin that could help, but there wasn’t anything remotely suitable. If I was going to get any help, I was going to have to write something myself.

Now, I’ve got plenty of high priority code-related work on my plate, so taking the time to write a tool like this required a non-trivial decision. What made me pull the trigger was a convergence of a few things. I was about to go on a work trip, and email always builds up when I travel. This conincided with my recently missing a couple of important Jira notifications due to volume, while other non-Jira emails were slipping through the cracks. I’d been consistently declaring email bankruptcy, about once a month, too.

The Summarizer

Since I was going to have to write my own tool, I could consider what I really wanted:

  • Notifications of changes to tickets that I care about to hit my inbox.
  • A managed TODO list of Jira tickets that have changed with some indication of priority, and if I should look at them.

I started with this quick algorithm:

  • Find all tickets that have changed in last X hours (more on X later)
  • Organize them by what field in the ticket changed
  • Find out what’s changed
  • Put that all into a nicely formatted email

That happens once an hour, and that alone would produce a nice hourly summary.

But what if I don’t deal with Jira for 7 hours? There would be 7 of those summaries to read, and worse, the same ticket might be in all 7, driving me nuts.

So, the program does more than just summarize:

  • First read the inbox, and find any summary email still in there
  • Instead of changes in last hour, go back and combine time frames
  • After sending a new email, automatically archive the older one.

Now I only ever have exactly 1 Jira summary email. To commit bankruptcy: just archive one email and start fresh!

The Jira Email Summarizer is available on Github.

A sample of the output:


SERVER-12351 Correct auditing comments in action_types.txt
   status: Open
   reporter: someone@10gen.com
   assignee: someone@10gen.com
   fixVersions: <version>
   priority: <priority>
   components: Logging,Security

SERVER-12350 Failed update with $mul errors with reference to $inc
   status: Open
   reporter: someone@10gen.com
   assignee: NONE
   priority: Minor - P4
   components: Updates
            Trivial to reproduce, just set a field to a string, then try to multiply it and you get the $inc error:

            db.foo.update({}, {$mul : {a : 2}}, false, {multi : true}, {ordered : false})
            Update WriteResult({

SERVER-12348 dropIndex is incorrectly labeled as auditing only in action_types.txt
   status: Resolved
   reporter: someone@10gen.com
   assignee: someone@10gen.com
   fixVersions: 2.5.5
   priority: Major - P3
   components: Security
            This issue is related to QA-341
            An Assignee
            In Code Review
      by: someone@10gen.com
         Code review url: http://codereview.10gen.com/6284539290714112
      by: xgen-internal-githook/internal-tools+githook@10gen.com
         Message: SERVER-12348 removed false comment from action_types.txt
         Branch: master

SERVER-12347 WriteBatchExecutor should re-use an UpdateDriver across all updates
   status: Open
   reporter: somesone@10gen.com
   assignee: NONE
   fixVersions: Needs Triage
   priority: Major - P3
   components: Internal Code,Performance

[Many more updates]

below supressed since should have gotten email