Outlook – Threading Jira notification emails in Outlook 2010

jiramicrosoft-outlook-2010

When I receive Jira 4.2 notification emails in Outlook 2010, they do not get threaded. Of course by default Jira sends emails with the subjects like this: [JIRA] Created: (LTST-4) improve documentation, [JIRA] Assigned: (LTST-4) improve documentation. I read online that Outlook 2010 solely uses the Subject field to thread, so having the subjects as above will force those emails NOT to be threaded, which is indeed the case. Note that Gmail, for example, doesn't thread those same emails either (but Apple iPhone 4 mail app actually does!).

So I tweaked my Jira setup to remove the 'action performed' verb from the subject and now the email subjects all look like this: [JIRA] (LTST-4) improve documentation. And Gmail happily threads them. But Outlook 2010 still doesn't!

Is there anything I can do in terms of Jira configuration or Outlook configuration to force Outlook 2010 to thread Jira notification emails?

Thanks, Kirill

Best Answer

The following VBA macro leaves only 1 message per Jira issue in your Inbox. It also deletes messages about Resolved/Closed issues, since I don't need to look at these

' Tools>References: Microsoft VBScript Regular Expressions 5.5, Microsoft Scripting Runtime

Sub RemoveDuplicateJiraKeys()
    Dim i As Object
    Dim re As New RegExp
    Dim m As MatchCollection
    Dim d As New Dictionary
    Dim act As String ' Commented, Resolved, Updated...
    Dim key As String ' e.g. RS-123

    re.Pattern = "\[JIRA\] (.*?): \((.*?)\)"
    For Each i In Session.GetDefaultFolder(olFolderInbox).Items
      ' luckily the items come in chronological order
      Set m = re.Execute(i.Subject)
      If m.Count >= 1 Then
        act = m(0).SubMatches(0)
        key = m(0).SubMatches(1)
        If d.Exists(key) Then d(key).Delete: d.Remove (key) ' same Jira key but older
        If act = "Resolved" Or act = "Closed" Then i.Delete Else d.Add key, i
      End If
    Next i
End Sub
Related Question