Hello, I know this is not a feature of osticket but I am wondering if it is possible with some workaround?
I tried to make a filter to close the ticket whenever the receipent's address equals the system's address but nothing happened.
I would like to be able to close the ticket whenever an assigned agent replies to the Assignment Alert email.
Thank you.

This is not a feature of osTicket at this time.

I do recall that there were some github posts about how to achieve this sort of functionality in the past, but you would have to go to https://github.com/osticket to look for those.

note: I think that it is likely in the old osTicket-1.7 repo. But well my memory isn't what it used to be. 🙂

@ntozier Thank you. I am looking into code modifications as an option.

But can you explain me what this filter does? I used a Filter Rule: Reply-To Email -> Equal -> support@my-domain.tld and two Filter Actions to change the ticket status and send me an email. None of the two actions worked. I expected this filter to work. Have I misunderstood something?

Another question I have (maybe not related) is the following. When I reply to a New Message Alert email, my reply becomes a Note in the ticket but when I reply to any other email alert (Assignment or Overdue for example), then a new ticket is created. Is this normal behaviour?

    kapcom01 But can you explain me what this filter does?

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

    kapcom01 Another question I have (maybe not related) is the following. When I reply to a New Message Alert email, my reply becomes a Note in the ticket but when I reply to any other email alert (Assignment or Overdue for example), then a new ticket is created. Is this normal behaviour?

    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.

      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...