ZAF Client Context gives WRONG Active Ticket ID when Agent changes between Multiple Ticket Tabs open in their Workspace

Answered


Posted Jul 30, 2022

Zendesk Issue    When Agent has multiple Ticket-tabs open in the Agent Workspace ( in a single Browser-Tab) inside their Zendesk account, and switching between multiple ticket tabs - the Zendesk Currently - Active Ticket-Id is wrong inside the ZAFClient Context for ticket_Sidebar Iframe Application

 

PROBLEM DESCRIPTION: 
When zendesk agent logs into their Zendesk account, and opens their first ticket, Ticket-1, it registers and loads our Sidebar application in Ticket-1 sidebar - at that moment, the ZAFClient Context has the correct current ticket ID, 'Ticket-1'..

Then Agent opens another ticket tab for Ticket-2 - at this point, since it has again reloaded Sidebar application in ticket sidebar, it SEEMs to correctly UPDATE the ZAFClient Context with the newly opened ticket's ID, i.e. 'Ticket-2'.

The Agent again opens a third Ticket Tab for Ticket-3. Now, agent has 3 ticket tabs open in her Agent-Workspace, with the Ticket-3_TAB 'ACTIVE' (selected) while the Ticket-1_TAB and the Ticket-2_TAB are both 'INACTIVE' (not selected).

Now when agent simply switches between the tabs (i.e. clicks on Ticket-1_TAB to make it the current 'ACTIVE' ticket tab), it DOESN'T SEEM TO UPDATE ZAFClient Context with the correct Ticket ID, i.e. it still shows 'Ticket-3' instead of 'Ticket-1'.

In other words, when multiple Ticket Tabs are ALREADY Open, and the Agent switches between the Ticket Tabs, the ZAF Client Context does not seem to be update with the CURRENTLY ACTIVE TICKET-ID. AT this point it is not clear if the ZAFClient Context will have either STALE ticket Id OR, it might RANDOMLY pick another ticket ID from any of the open Ticket Tabs.

This creates a significant problem for any Sidebar Application trying to service the SPECIFIC TICKET that Agent has open and is trying take any updates.

 

DESIRED SOLUTION/BEHAVIOR:

What we want is that the ZAFClient Context ALWAYS has the correct Ticket-ID of the Currently ACTIVE Ticket-Tab in the Agent's Workspace. 

 

ATTEMPTED FIX - BUT, DOES NOT WORK

We actually tried using "app.activated" event as shown in the code snippet below, to look for active tab's ticket information from the context, but it picks up wrong ticket id when the Agent switches the Active Ticket Tab. So it gives wrong Ticket-ID without showing any Error message/indications. 

 

HERE IS THE CODE WE HAVE TRIED

var zafClient = ZAFClient.init(); 
zafClient.on('app.registered', e => {
zafClient.on("app.activated", function(context) {
console.log(context);
console.log(context.ticketId);
sessionStorage.setItem("zdTicket",context.ticketId);
}) });

 

===== >>  COULD Zendesk Support Team PLEASE: 

1) Share a working example of how to get the correct Ticket-ID when the Agent switches/jumps between already open Ticket Tabs in their workspace?

2) Are we using the wrong event or error in the code?  Please help us resolve this at your earliest convenience. 

 

Thanks a lot.  :-)


1

5

0 comments

Sign in to leave a comment.

Didn't find what you're looking for?

New post