Zendesk Pop Out the application with the data from Zendesk Admin conf and Other Ticket related Data



Publicado 28 mar 2022

Hi Team,

I was trying to Pop-Out my app with the click of a button.
The pop-out part is working but once the app is opened in a new pop-out window it detaches with the data from the Zendesk Ticket.
It is not able to get the data like.

ticket.id, ticket.requester.email etc


The code block I am using is below :

function openModal() {
ZendeskService.zafClient.invoke('instances.create', {
location: 'modal',
size: { // optional
width: '80vw',
height: '100vh',
},
}).then((data) => {
console.log(data);
});
}

This is not providing me with any data from the Zendesk Ticket.
Here is my ZendeskService class for reference.

class ZendeskService {
static zafClient;

static initialize(callback) {
try {
DomService.loadScript(ZENDESK_URLS.SCRIPT, () => {
if (window.ZAFClient) {
ZendeskService.zafClient = window.ZAFClient.init();
if (typeof callback === 'function') {
callback();
}
}
});
} catch (error) {
console.error(`Failed to load Zendesk client: ${error}`);
}
}

static get = async (key) => {
if (ZendeskService.zafClient) {
try {
return (await ZendeskService.zafClient.get(key))[key];
} catch {
return null;
}
}
return null;
};
}

export default ZendeskService;

0

1

0 comentarios

Iniciar sesión para dejar un comentario.

¿No encontró lo que buscaba?

Nueva publicación