Parsing text from last comment field to the end of summary field

Issue #183 resolved
Shai Dahan created an issue

Hello Fidel,

I hope you are keeping well and you have a lot of success with your add-on, which I find very good. I wonder if you can help me again with parsing text from an email that we receive (which shows in the comment obviously) to the end of the summary field of the the Jira ticket. An example of reply is:

Original issue summary: GCI (GI-20265) - Da Vinci Diamonds Dual - Broken- VIP 13

Last comment contains the following reply: Subject: RE: [GCI Jira] (OCC-14813) GCI (GI-20265) - Da Vinci Diamonds Dual - Broken- VIP 13 [ ref:_00D30iVRS._50014smU7L:ref ]

Desire result of the summary: [GCI Jira] (OCC-14813) GCI (GI-20265) - Da Vinci Diamonds Dual - Broken- VIP 13 [ ref:_00D30iVRS._50014smU7L:ref ]

Thank you in advance for your help Shai Dahan

Comments (10)

  1. Fidel Castro Armario repo owner

    Hi Shai,

    I need some additional information:

    1. Which are the invariant parts of the prefix [GCI Jira] (OCC-14813)? Or if you prefer it, Which are the variable parts of that prefix? I suppose that 14813 is variable, but Is also OCC and GCI* or GCI Jira**?
    2. Which are the invariant parts of suffix [ ref:_00D30iVRS._50014smU7L:ref ], or if you prefer it, Which parts are the variable parts?
  2. Shai Dahan Account Deactivated reporter

    Hello Fidel,

    • The invariant parts of the prefix is the summary of the original ticket
    • The suffix should be everything which is within the brackets

    Different example: Original summery: "Bonus Game Issue. Indiajaya" Response from IGT received as an email which contain the following Subject: "Subject: RE: [GCI Jira] (OCC-14436) Bonus Game Issue. Indiajaya [ ref:_00D30iVRS._50014slPqN:ref ]" Desired summary: "Bonus Game Issue. Indiajaya [ ref:_00D30iVRS._50014slPqN:ref ]

    I hope it's clear enough

    Thanks Shai

  3. Shai Dahan Account Deactivated reporter
    • Different example:
    • Original summery: "Bonus Game Issue. Indiajaya"
    • Response from IGT received as an email which contain the following Subject: "Subject: RE: [GCI Jira] (OCC-14436) Bonus Game Issue. Indiajaya [ ref:_00D30iVRS._50014slPqN:ref ]"
    • Desired summary: "Bonus Game Issue. Indiajaya [ ref:_00D30iVRS._50014slPqN:ref ]

    reformatting my last comment

  4. Shai Dahan Account Deactivated reporter

    Hello Fidel,

    Thank you for that, it does the trick, however I need it to only to be copied once and if the summary only contained IGT reference I don't want it to be copied over and over again you did it before by matching the string to find out whether it already contains the parsed text.

    Thanks, Shai

  5. Fidel Castro Armario repo owner

    I implemented the behavior to avoid repetitions, but made a mistake in the text to be parsed. Use the following one instead:

    %{00000} + (%{00000} !~ "[ ref:" AND %{00061} != null ? " [ ref:" + %{00061} + ":ref ]" : "")
    
  6. Shai Dahan Account Deactivated reporter

    OK cool, I've found the difference between the two strings Thank you very much it works as a charm :)

  7. Fidel Castro Armario repo owner

    Sorry, I edited my previous post and corrected the mistake.

    The incorrect string was:

    %{00000} + (%{00000} !~ "[ :ref" AND %{00061} != null ? " [ ref:" + %{00061} + ":ref ]" : "")
    

    The correct string is:

    %{00000} + (%{00000} !~ "[ ref:" AND %{00061} != null ? " [ ref:" + %{00061} + ":ref ]" : "")
    
  8. Log in to comment