最近の検索


最近の検索はありません

Zendesk - How to detect if I Change (before submit) Requester Name in opnened Tickets.

回答済み


投稿日時:2022年7月25日

Hi everyone,

I have a server side app, which display customer info such as name, id, email etc based on currently opened ticket.
My next task is to update the Requester name in Zendesk App ( server side app ) if i made changes in Ticket Requester before submit.

is that possible?


0

5

5件のコメント

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey richestsoft dev!

Changes you make to the requester of a ticket will be available to the ticket.requester object immediately, even before you hit submit. This means that you'll be able to access the new requester data in your app and manipulate as needed be prior to the ticket being saved e.g:

const getRequester = async () => {
const requester = await client.get("ticket.requester");
const requesterName = requester['ticket.requester'].name;
console.log(requesterName);
};

I hope this helps! Feel free to reach out with any questions.

Tipene

 

0


Thank you for you response.
This is not working for me when I change requester name.

0


I am sharing my script what i am trying to do.

Its a server side app developed in nextJs

const [requesterName, setRequesterName] = useState(null);
const getRequester = async (client) => {
const requester = await client.get("ticket.requester");
const _requesterName = requester['ticket.requester'].name;
console.log(_requesterName);
setRequesterName(_requesterName)
};
 
var client = ZAFClient.init();
getRequester(client);
the function getRequester(client) is getting called onLoad

in the html section

<p>{requesterName}</p>

0


Update

 

the following worked for me.

if (client) {
    client.on('ticket.requester.name.changed', function(e) {
        console.log("name is :", e)
}); }

 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey richestsoft dev,

Thanks for the update - I'm glad you've got it working!

Have a great day :)

Tipene

0


サインインしてコメントを残してください。

お探しのものが見つかりませんか?

新規投稿