Menu

Mail to ticket automation - not updating existing ticket

Jendra
2024-07-18
2024-08-06
  • Jendra

    Jendra - 2024-07-18

    Hello,

    As in topic i created IMAP connection to one of ours mailboxes. Then I mapped the folder from the mailbox so that itop read emails only from a given folder to create incidents. As it is for incident we did not make some typical id numeration like sugestes in documentation (R-00001 likely). We sugested to use mail subjects itself as they came to us. Following that i created REGEX that would skip typical Gmail prefixes Re: and Fwd:

    (?!.*\:)(?! )(.*)
    

    I tested this regex and it's sucesfully worked in typical behaviors on https://regex101.com/
    After testing, I put the regex into itop and sent test messages. First, the original message on the basis of which the ticket was to be created, and then the reply to the message that was to update the ticket. My tests show that the regex works as expected, unfortunately iTop itself does not update the ticket, but creates a new one.
    Bellow i attach screens from configuration of extension, and debug it sefl where you can see that the regex works completly fine.
    config
    debug
    To be honest i don't have idea what could be wrong right now. I read documentation several times and nothing helped.
    iTop version 3.1.1-1-12561
    Extension Version: 3.7.2

    Ps. The version in the documentation is 3.7.4 and in the add-ons store it is 3.7.2

     

    Last edit: Jendra 2024-07-18
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2024-07-18

    The "title pattern" is used to match an e-mail to a ticket. The title pattern is meant to configure the pattern of a ticket reference, e.g. R-123456. If such pattern is found; iTop checks if there is a ticket with this reference (= "ref" field in the user request or other ticket type in iTop).

    Combodo's implementation doesn't include a feature to do so on the rest of the mail subject.

    You could use my fork of Mail to Ticket Automation and create your own logic. I've written such customizations for some of my customers.

     
    • Jendra

      Jendra - 2024-07-18

      So following your description it's possible to do but it requires additional customization in PHP code right ?
      Also in documentation "Determines whether a Ticket must be created or updated based either on the custom headers added by iTop in the eMail (in case of replies) or based on a configurable pattern in the title" i kinda misunderstanding following that tittle pattern "...the application can parse the “subject” field to look for a given match. " So the application should find the email by subject pattern. Isn't that a bug ? The app correctly exclude prefixes, it's searching for title pattern as it is, but not finding anything ?
      By the "ref" u mean field that is added to eml following by creating ticket by user trough portal ?

       
      • Jeffrey Bostoen

        Jeffrey Bostoen - 2024-07-18

        It's not a bug, it's designed to find a pattern in an e-mail subject; and use that match (e.g. "R-123456" to look up a corresponding ticket). By "ref" I mean the ticket reference stored in iTop / in the database; which you can indeed include in email notifications.

        And yes, it's possible; some of my customers are using such logic.

         
  • Jendra

    Jendra - 2024-08-05

    Thank you Jerrfey for you share of knowledge. I made it possible by creating script that create new message with REF field in subject of the email. By this i can say that it works like it should now. Thanks a lot again :)

     
    👍
    1
  • jym972

    jym972 - 2024-08-06

    Our tickets numbering looks : R-240806-026362

    Our pattern is /R-([0-9]{6})-([0-9]{6})/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.