최근 검색


최근 검색 없음

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


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물