In an incoming mail handler with Strip Quotes = True, exactly how does JIRA determine what counts as quoted material?

K Watkins September 10, 2015

The first time we send an email thread to an existing JIRA issue, we want the whole thread. Thereafter we want only the latest message in the thread.

On the theory that JIRA distinguishes one thread from another by the subject line, I set the incoming mail handler to strip quotes, and then expected to get the whole thread the first time I added the JIRA ID to the subject line. That theory is clearly wrong. Every time, whether the thread is new to the JIRA issue or not, what I actually get is: sometimes the whole thread; sometimes only the latest message; sometimes something in between! (Moreover, the subject of the thread is apparently lost when the material is pulled into JIRA.)

I'm hoping there is a way to edit the thread before sending it the first time, but for that to help, we need to know how JIRA determines where the quoted material in a string begins.

Better still, of course, would be for JIRA to check the subject of the thread, and stripping quotes (in a consistent manner) only if the issue has previously received comments with the same subject. But until then, we need a workaround.

Notes:
A) We are on JIRA Cloud.
B) The question here is about adding comments to an existing issue.The option to create a new issue from email is not germane.

4 answers

1 vote
Piotr Klimkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2015

Subject is only used to find the corresponding issue. In case no match is found JIRA also tries to find the issue by consulting "In-Reply-To" and "References" message headers but that's irrelevant in this case.

Non quoted mail handler will try to strip lines starting with ">" or "|", lines that look like attribution "On Fri 11 Sep, someone said:" or anything after typical Outlook response to markers like "----Original Message----" (consult outlook-email.translations file for complete list).

Stripping quotes is somewhat complicated given the number of formats being used to reply to a message. In particular, better Outlook support is requested here: https://jira.atlassian.com/browse/JRA-14543

 

K Watkins September 11, 2015

Thanks, Boris. This is a useful start. The scenario I'm looking for is one where I can set Strip Quotes = TRUE and still get the whole thread in the comment the first time the email goes to the JIRA issue. If the subject is outside JIRA;s ken, then I'm guessing that the only way to do this is to manually remove whatever JIRA takes to indicate part of the message as quoted. So my question is -- What does JIRA use to identify the quoted part of an email message? If it's 'the "From" bit, what is that?

1 vote
Boris Berenberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2015

The subject is ignored 100% for the comment handler for anything other than looking for an issue key. For example, assuming strip quotes is disabled if you have a ticket ABC-123:

Email 1:

Subject: Hey everyone ABC-123

Body: Test1

Email 2:

Subject: Sup everyone ABC-123

Body: Test2

Email 3:

Subject: Yo everyone ABC-123

Body: Test3

Subject: Sup everyone ABC-123

Body: Test2

The contents of the ticket would be:

Comment 1:

Test1

Comment 2:

Test2

Comment 3: 

Test3

Subject: Sup everyone ABC-123

Body: Test2

Not 100% sure, but I believe that split quotes is based on the "From:" bit.

0 votes
K Watkins September 25, 2015

I appreciate your involvement, Boris, but my results don't bear out your expectations. Either I don't know what a From: field is, or Jira Cloud doesn't use that field to demarcate quoted material in an email thread.

I set up a strip-quotes email handler, and I found that earlier messages come through when they have a multi-line header section showing From - Date - Subject - To - Cc, but *not* when the earlier message is indented under a single line saying, 'on [date] at [time], [name <email address>] wrote:'.

After a bit of experimentation, my best guess is that the trigger is the indentation. When I inserted un-indented material in the earlier message, that material came through, though the indented material around it didn't.

More usefully, I found that I can un-indent, and thus retain, multiple previous messages in a thread by copying them into a text editor that strips out formatting (like Notepad, in Windows) and pasting the unformatted text back into the message I am sending. This suffices for my present purposes.

Please note, however, that I did this experimentation in Gmail. Since I still don't know just how Jira Cloud identifies quoted material in email, I don't know how far my results might apply elsewhere.

Piotr and Boris, thanks again for your help.

0 votes
K Watkins September 21, 2015

Thanks for your info, Piotr!

I can’t find outlook-email.translations. Since we're on Cloud, perhaps we can't edit it; but can we even see it (or its Cloud equivalent)?

If not, could someone please provide a copy of the markers it recognizes for defining quoted material?

Boris Berenberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2015

You can not use Piotr's method for Cloud.

K Watkins September 22, 2015

Thanks, Boris. Where can I find out exactly how JIRA Cloud identifies quoted material? It sounds like there are several ways. If I know what they are, I hope to figure out a method (manual if necessary) to minimize quoting of unwanted material, and yet keep quoting of desired material.

Boris Berenberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2015

Like I wrote above, I believe it simply splits on the "From:" field.

Suggest an answer

Log in or Sign up to answer