I’m using ticket states to filter ticket listers for takeout orders. Since tickets can be paid while they’re waiting to pickup the order I may need a way to update a ticket state after its be paid/closed. I know we can adjust the ticket closing flow as I saw Emre’s example, but I’d prefer not to mess with the default ticket closing method. Would it be okay to create an automation command to:
Load Ticket
Reopen Ticket
Update TICKET State
Close Ticket
It seems to work fine, I just don’t love the idea of reopening closed tickets. I also can’t seem to find a way to test if the ticket is in a closed state.{TICKET STATE:Status} displays Paid and not Closed. Any idea how to reference if a ticket is closed?
There is nothing wrong with reopening closed tickets. You are closing them again anyway so it’s fine. Ticket state status never equals closed. Mark Ticket As Closed happens as long as it’s paid anyway.
The Before Ticket Closing rule takes care of that.
Sounds good. Is there anyway to restrict the action if the ticket is already closed? There is going to be situations when I need to update the ticket state on an open ticket.
No need to reopen on open ticket. But yes it’s fine.
The field IsClosed in the Tickets table is what you would reference. It’s not a state. It happens in the Before Ticket Closing rule. It will happen anytime the constraint is met.
It looks like {REPORT TICKET DETAILS:T.IsClosed:T.Id=[:CommandValue]} only works for the current work period. I have a ticket left open and this is producing no result. Is there anyway around that? (I know for most this wouldn’t be an issue, but it is with Virtual Work Periods).
If that doesn’t work I’ll just take off the constraint and always reopen ticket (even if the ticket is currently open).
The ticket was in a closed status and still didn’t return anything. I also tested this in a report. I’m assuming its not returning True because a new virtual work period had started this morning.
Test it in a report and choose date range of that ticket… does it show?
Yes Report tags used in automation only see current WP. I am not sure why you are constraining to that though? Why do you need to check if ticket is closed?
I was checking if the ticket was closed to see if I need to fire ‘Reopen Ticket’ action before updating the ticket state ‘Takeout’ from Waiting to Received. Since it doesn’t seem to matter, I’ll just have it always Reopen Ticket.
Once the ticket has state isClosed = 1, it will not allow you to change any states of the ticket. For some reason having Closed ticket in the ticket widget screen will break the queue and will not allow you to change state of any other tickets within that Ticket Lister widget.
So you can always use buttons like Received in your case to change the state, do everything else and only then settle the ticket.