ntozier Nope. You have not provided all the fields for the filter.

Im sorry I wasnt clear. I took the following two screenshots of a filter. My expectation is that if someone (for example the assigned agent) replies to any email that is related to some ticket, then this ticket will be closed. Obviously I am wrong but why? Can you explain what the following filter does?

ntozier Ticket Filters only fire at Ticket Creation.

Ooops I missed that in the documentation.. Sorry. 👍

ntozier Agents reply to tickets via the UI.

If you are the assigned agent and you reply to the ticket it will update it with an internal note.
If you are not the assigned agent and you reply it will make a new ticket since you are not associated with the ticket in any way (being assigned).
Yes, this is expected behavior.

But even though I am the assigned agent, when I reply to the "Ticket Assignment Alert" email a new ticket is created. Is this a bug?

Did you replied to the latest email sent from osTicket?
If you replied out of order it will open a new ticket.

    ntozier I did reply to the latest and only email from osticket.
    1) A user opened a new ticket from the web interface.
    2) The ticket was assigned to an agent according to the Help Topic options.
    3) This agent received a New Assignment Alert email.
    4) This agent replied to this email.
    5) A new ticket was created.

    Then I dont know.

    You arent a collaborator on the ticket, and/or it is having a hard time determining which ticket to attach the response to.
    Do you have the ticket number in your email alert subjects?

    The following screenshots show a new ticket creation and what happens when the assigned agent replies to the "Ticket Assigned to you" email:



    The following show what happens when the assigned agent replies to the "New Message Alert" email:


    In the first case a new ticket is created (probaly a bug?), and in the second case a Note is created as expected.

      kapcom01 "Ticket Assigned to you"

      They are replying to the "Ticket Assigned to you Alert". This does not update the ticket... and should result in a new ticket as it is not part of the ticket or the existing email chain or ticket thread. It is a new email.

      Hmm, OK then. At least I know it is not a bug
      Thank you very much for your time!
      I appreciate it!
      😃

      ntozier One last question. What do you suggest me to do to achieve something as close as possible to what I want?
      I want somehow the assigned agents to not have to login to the web platform. Ideally I would like them to receive and close the ticket by email.

      As a last resort, I am thinking of making a script to read the new emails and close the ticket by changing the status_id on the db.

        You would have to modify the core files to achieve this.
        osTicket is currently designed for the Agent to use the web UI to update, and manage tickets.

        I recall a posts on github about getting ticket filters to file on ticket updates, and api enhancements for older versions. They were not got 1.15.x but you could probably use them to point yourself in the right direction.

        a month later

        kapcom01 As a last resort, I am thinking of making a script to read the new emails and close the ticket by changing the status_id on the db.

        I just want to report that I did make that script. It is not tested in production yet, but with test tickets works fine.

        On Debian server:
        apt install fdm procmail

        create file /root/reply-close-script/fdm.conf:

        set lock-file "/root/reply-close-script/fdm.lock"
        set queue-high 1
        
        action "osticket-close" {
                mbox "/root/reply-close-script/INBOX.backup"
                write "/root/reply-close-script/mail.tmp"
                exec "/root/reply-close-script/reply-close.sh >> /root/reply-close-script/reply-close.log"
                exec "rm /root/reply-close-script/mail.tmp"
        }
        
        account "osticket@mydomain.com" imaps server "mail.mydomain.com"
                user "osticket@mydomain.com" pass "mypassword" new-only keep
        
        match all action "osticket-close"

        create file /root/reply-close-script/reply-close.sh:

        #!/bin/bash
        
        exit_code=1
        dbname="osTicket"
        mariadbconf="/root/reply-close-script/mariadb.conf"
        mailfile="/root/reply-close-script/mail.tmp"
        
                # search for ticket number in Subject
                ticket_number=$(formail -c -x Subject < $mailfile | php -r 'echo iconv_mime_decode(stream_get_contents(STDIN),1,"utf-8");' |  perl -n -e'/#(.*)$/ && print $1');
                # if found:
                if [[ -n $ticket_number ]]
                then
                        # close the ticket in db
                        echo "[$(date --iso-8601=seconds)] closing ticket #$ticket_number"
                        sqlquery="UPDATE \`ost_ticket\` SET \`status_id\`=3, \`isanswered\`=1 WHERE \`number\`=\"$ticket_number\""
                        /usr/bin/mysql --defaults-extra-file=$mariadbconf $dbname -sN -e "$sqlquery"
                        exit_code=0
                else
                        echo "[$(date --iso-8601=seconds)] ticket not found in $mailfile"
                fi
        
        exit $exit_code

        create file /root/reply-close-script/mariadb.conf:

        [client]
        user=root
        password=mypass

        add a job with crontab -e:
        */5 * * * * fdm -v -f /root/reply-close-script/fdm.conf fetch >> /root/reply-close-script/fdm.log 2>&1

        Write a Reply...