Send email when ticket is older than reopen period

Hi Guys

I have an existing rule that monitors our client facing mailbox. This rule will check for emails with a ticket number in the subject line and do the following:

  1. If the ticket is open, then update the ticket, change status, etc and move the email to another folder to indicate that the email has been processed.
  2. If the ticket is closed and an email is received within a 7 day window after closure, then the ticket is reopened. The email is then moved to another folder to indicate that it has been processed.

This is the rule that I am referring to: (MSPintegrations)

After reading the post on how to prevent closed tickets from reopening, I noticed that there is an improvement that can be made to my rule.

I need to add a third step that if an email is received with a ticket number in the subject line and it does not meet the criteria of steps 1 and 2, it then it needs to email the sender that the ticket has been closed and a new ticket logged.

I believe I need 2 new steps, 1 to check if it fails the other 2 steps and another to send the actual email. I am just not sure how to map this out.

Thank you.

Hey @Kalin !

Great question, and thanks for posting here!!

For reference, here is your rule as it stands today (with some redacted info):

You will want to replace the action in Step 3 with two new actions, and these two new actions will use the same expression as Step 3 to only fire if Step 1 and Step 2 didn’t fire. Here’s the expression from Step 3:

The first action to replace Step 3 will be a “Create Ticket” action to create the new ticket, and the second action will be a “Send Email” action to send the email.

Let us know if you need any specifics, but that’s the high-level overview.

A quick recommendation: I would start by first cloning the rule you linked and making all changes to the clone. When it’s ready, enable the clone and disable the original rule. This makes it easy to revert your changes if needed.

Let us know how it goes!

1 Like

Hi @Travis

Thank you for your response and your guidance.

I did follow your recommendation and created the clone rule which I will test with later this evening. Instead of creating 2 actions, I have opted for just one which is to log a new ticket as this will send the email sender a notification a new ticket email anyway. Another email through Email2AT would be redundant.

Thanks again for the idea and guidance.

Hi @Travis

Would you mind giving the new rule I created a once over to check my logic?

If an email comes through without a ticket number in the subject, I do not want Email2AT to automatically log a ticket. It should leave the email as is in its original folder.

Ideally this is what I want to achieve, if an email is received with a ticket number in the subject line, Email2AT must do the following:

  1. Check for an open ticket and update it, etc.
  2. If ticket is closed and closure date is within 7 days, reopen ticket, etc.
  3. NEW RULE - Log a new ticket

@Kalin

Sure thing. Please send the URL to an example history log that uses the new rule you created or the URL to the rule itself so I can check it out.

Thanks @travis

Here is the link to the new rule which is currently inactive : MSPintegrations

I am wondering if I shouldn’t add a condition to the “Only perform this action if the following condition is met” on Step 3 to check if the email subject contains anything that looks like a ticket number but I am not sure how I would accomplish that.

First, I will summarize what I see in the mailbox:

Step 1 is configured to update the ticket only if it is not complete. The results from step 1 are stored in custom.update_result_a:

Step 2 is configured to update the ticket only if it was completed within the last week and if the email is not an Automatic Reply:

Step 3 is configured to create a new ticket only if it wasn’t updated from step 1 or step 2:

From what I can see, your logic for updating existing ticket is:

  1. If the ticket is not complete, update in Step 1 and continue with other steps.
  2. If the ticket was recently completed and is not an Automatic reply, update in Step 2 and continue with other steps.
  3. If the ticket was not updated in Step 1 or Step 2, create a new ticket in Step 3
  4. If nothing fired, stop in Step 4.
  5. Move the email to a new folder
  6. Stop

How are you intending to change this logic/behavior? What steps would you like to act differently?

Also, a quick note: I see that you used {{before_string email.body "*** Please enter replies above this line ***" flags="t"}} to extract the original part of the email. You can use {{email.body_stripped.visible}} to do that automatically (see docs here).

1 Like

Hi @travis

Thank you for giving this a once over, I do appreciate your insight and advice on using the {{email.body_stripped.visible}} feature. Based on what you explained this will work as intended.

This mailbox sometimes receives emails from internal and external recipients where a ticket does not need to be created. So, my question is, will the above logic only work if there is a ticket number in the subject line?

If an email comes through without a ticket number in the subject line, then I need that email to be left untouched in the Inbox.