Issue with Display Ticket Action (Ticket not displaying)

I’m having an issue with my function which opens/creates a new table based on the customer name (pulled from a credit card). This was previously working, however now it won’t open a ticket and I’m not sure where the issue occurred. I’ve tracked it down to the final action which displays the ticket. The action should be firing, but the ticket does not show.

I have some alerts to show how many tickets are found based on the customer entity name as well as the applicable ticket number.

In this case ticket 16 is supposed open. Any ideas?

Previously on the “New Ticket” screen it would load in the open ticket for “RUSSELL JOSEPH”. Now if there is a ticket open it won’t load.

If I close out the “RUSSELL JOSEPH” ticket it will create a new one and I can add orders. No sure if I mad a change to cause this. I set alerts to test each process down to the “Display Ticket” action firing. Still nothing.

Any ideas on this? I’m at a loss.

This will occur if you attempt to open an invalid Ticket ID. A text string containing spaces is not a valid id. It must be a single numeric value. In the case of your single ticket “16”, it should work. You would need to provide some more details of the state of things before those rules are fired.

Some actions are designed to work in specific contexts and don’t always behave as expected (until you become familiar with the valid contexts and limits). The Ticket screen is a special case for example. It’s a “modal” screen which means it needs to be closed before various other actions are recognized. It’s living in a kind of protected environment, it can only work on one ticket at a time, so that places restrictions on what you do while a ticket is open.

You need to be aware of the execution context of rules (events) and become familiar with the available TAG values in each event. Be careful about assuming which data is available in each rule.

While building new automation it is very useful to display a lot of debugging values using Show Message in every rule.

These are generic suggestions and maybe not directly related to this specific issue.

1 Like

Thanks for the reply @philbkk. This structure worked before and I’m not sure how this is seen as a string. I can provide any rules, actions that you request.

Its a stored local value. The customer string is only used within the filter of the {Report Ticket Details} which pulls in the ticket id. After the ticket id is obtained it is used within the ticket screen to execute Display Ticket with the proper ID. This has been working and now it isn’t. I’m sure its something small I’m missing, but I’m not sure. I think I spent 2 hours on it last night. Everything seems to be right down to the last action.

Is 16 really the Ticket ID or is it the Ticket NO? It looks to be Ticket NO in that case it wont work. Display Ticket uses Ticket ID not Ticket No

EDIT look at your report syntax that your feeding into your store setting. Its T.TicketNumber that is not Ticket ID and so it will not work with Display Ticket action.

I would be surprised if that ever worked.

That makes a lot of sense now @jesse. This was a fresh install, fresh DB. So then what is the best route either:

(1) Different action - I saw load ticket has a entity search action. Possibly do that with a ticket resfresh
(2) Run a script to pull in the ticket ID - I saw something that JTRTech posted previously.

function getTicketId(inputTicketNumber) {
	var ticketIdQry = "SELECT [Id] FROM [Tickets] WHERE [TicketNumber] = '"+inputTicketNumber+"'";
	var ticketIdLookup = sql.Query(ticketIdQry).First;
	return ticketIdLookup;
}

The purpose of this process is for the bar. Our staff works in a “new ticket” Department and they want to be able to swipe a credit card to create and access customer tickets, rather than typing in a customer name.

Thanks again,
JCR

You can probably use the same report but use T.Id instead of T.TicketNumber

Just try making that edit instead of changing everything around.

Thanks Jesse. This fixed the issue. Oddly enough I was one ticket id off from the ticket number.

I really appreciate your help!

1 Like

Probably why it used to work is your TicketNo at some point was in sync with Ticket ID but that was bound to fail at some point. This caused you to overlook it long time ago.

Yep, it all clicked when you said:

Thanks for letting me know about T.Id. I didn’t see it in the Custom Reports post (v4) or as an autofill in the custom reports editor.

T.Id is kind of hidden. Typically you can reference any absolute Column with T.ColumnName, Report syntax is very predictable.