在Outlook 2010中线程化Jira通知电子邮件


9

当我在Outlook 2010中收到Jira 4.2通知电子邮件时,它们不会被线程化。当然,默认情况下,Jira会发送主题如下的电子邮件:[JIRA] Created: (LTST-4) improve documentation[JIRA] Assigned: (LTST-4) improve documentation。我在网上阅读到Outlook 2010仅使用“主题”字段进行穿线,因此具有上述主题将迫使这些电子邮件不被穿线,的确如此。请注意,例如,Gmail也不对这些电子邮件进行相同的处理(但Apple iPhone 4邮件应用程序实际上对!)。

因此,我对Jira设置进行了调整,以从主题中删除“已执行操作”动词,现在电子邮件主题都如下所示:[JIRA] (LTST-4) improve documentation。Gmail可以愉快地将它们线程化。但是Outlook 2010仍然没有!

我可以在Jira配置或Outlook配置方面强制Outlook 2010对Jira通知电子邮件进行线程处理吗?

谢谢,基里尔

Answers:


5

以下VBA宏在收件箱中的每个Jira问题中仅留下1条消息。它还会删除有关已解决/已解决问题的消息,因为我不需要查看这些消息

' 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

1

Outlook 2010仅按主题安排对话(线程)。从JIRA中的电子邮件主题中删除“操作”应将它们放在Outlook收件箱中。听起来您可能需要检查Outlook设置。更多信息请点击这里


1
是的,这就是我的想法。不幸的是,不会发生。主题完全相同的邮件不会串在一起。我也看到了您提到的链接,那里没有任何相关内容。
kirillka'5

0

我使用了其他答案 文章的组合,并且本文编写了自己的宏,该宏使用Redemption库合并对话。

这将扫描当前文件夹,挑选出所有jira电子邮件,并从主题中提取问题密钥。如果它没有见过那个键,这样可以节省根据问题的关键集合中的谈话指标,如果它已经看到它之前,它更新与保存的交谈指数的电子邮件。

Dim ConversationIndexes As New Collection

Sub GroupJira()
    Dim MapiNamespace As Object
    Dim RdoSession As Object

    Dim Item As Object
    Dim RdoItem As Object

    Dim ConversationKey As String
    Dim ConversationIndex As String

    ' Get all the required handles
    Set MapiNamespace = Outlook.GetNamespace("MAPI")
    MapiNamespace.Logon
    Set RdoSession = CreateObject("Redemption.RDOSession")
    RdoSession.MAPIOBJECT = MapiNamespace.MAPIOBJECT

    'Setup some subject patterns to extract the issue key
    Dim Matches As MatchCollection
    Dim UpdateSubjectPattern As New RegExp
    UpdateSubjectPattern.Pattern = "\[JIRA\] \(([A-Z]+-[0-9]+)\) .*"
    Dim MentionedSubjectPattern As New RegExp
    MentionedSubjectPattern.Pattern = "\[JIRA\] .* mentioned you on ([A-Z]+-[0-9]+) \(JIRA\)"

    For Each Item In Outlook.ActiveExplorer.CurrentFolder.Items
        If TypeOf Item Is MailItem Then
            If Left(Item.Subject, 7) = "[JIRA] " Then
                ' Get a key for this conversation, opic for now
                ConversationKey = Item.ConversationTopic
            Set Matches = UpdateSubjectPattern.Execute(Item.Subject)
            If Matches.Count >= 1 Then ConversationKey = Matches(0).SubMatches(0)
            Set Matches = MentionedSubjectPattern.Execute(Item.Subject)
            If Matches.Count >= 1 Then ConversationKey = Matches(0).SubMatches(0)

                ' Get any saved indexes
                ConversationIndex = ""
                On Error Resume Next
                ConversationIndex = ConversationIndexes.Item(ConversationKey)
                On Error GoTo 0

                If ConversationIndex = "" Then
                    ' Save this index if not seen yet
                    ConversationIndexes.Add Item.ConversationIndex, ConversationKey
                ElseIf Item.ConversationIndex <> ConversationIndex Then
                    ' Set the item's index if it has
                    Set RdoItem = RdoSession.GetMessageFromID(Item.EntryID, Item.Parent.StoreID)
                    RdoItem.ConversationIndex = ConversationIndex
                    RdoItem.Save
                End If
            End If
        End If
    Next Item
End Sub

这需要以下库:

  • 用于完全RDO访问的兑换库,需要设置会话索引(不需要提升即可注册)
  • Microsoft VBScript Regular Expressions 5.5库的引用,以从邮件主题中提取发布密钥。

哦,您还需要调整宏安全性设置才能运行它。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.