Issue with Query

Hi,

I am building a rule that looks for a Ticket number and if its not complete update the ticket or if the ticket has been completed and the completion date is within 14 days update the ticket.

I have the below query which seems to be adding 14 days to today’s date and not the completion date

The history shows:

Any ideas please?

Hi @Koris365

From what you’ve shared, I suspect the change may be as simple as changing the date string to this:

{{date subtract="14 days" to_tz="Autotask"}}

That will give you the date 14 days ago. You should also change the query to find the ticket if Completed Date is greater than or equal to (not less than or equal to).

This will query for any ticket where the status is not complete or where the ticket was recently completed.

Let us know how that works for you!

HI Travis,

The Query was originally subtract but I have changed it again to see and again its taking the 14 day subtraction from todays date and not the completed date of the ticket.

The test I ran, I used a ticket that was closed on the 5th January but the AutoTask query result produced the following:
TicketNumber = "T20230717.0199" AND ((Status != "5") or (CompletedDate` <= “2024-08-20 04:01:56”))"

Ideally I want the query to look for 14 days after 5th January, so roughly the 19th January.

Just for clarity, what I am trying to achieve is if a ticket is closed today 03.09.24, the customer will have up to 14 days to reopen the ticket (17th Sept), after that it will not reopen.

If there is an easier way to do this please let me know.

Can you provide the URL to your rule?

Hi,
Hopefully that helps:
https://console.mspintegrations.com/#/email2at/advanced/mailboxes/hosted/170430499002264/rules/172528123308696

Thanks.

I looked over your rule, and my previous answer is still the right way to do it. Configure your rule like this, filtering for tickets where Completed Date is greater than or equal to {{date subtract="14 days" to_tz="Autotask"}}:

When this action processes an email, it will attempt to locate a ticket in Autotask that is not complete or where the Completed Date is greater than 14 days before now. In other words, this will correctly identify tickets that are open or were recently closed.

For example, if you run this action right now, it will search for an Autotask ticket that is not complete or it was completed more recently than 2024-08-20 14:45:00 UTC. If the ticket was completed on 2024-08-20, or 2024-08-21, or 2024-08-30, or 2024-09-02, this rule will update it. If the ticket was completed before 2024-08-20, it will not update it.