Read User_Fields globally from all locations (for example: ticket_sidebar)?
Hi, in order to retrieve data from an external API (By button click in the app) I want to query a user field. Note: I want the app to appear only in the ticket_sidebar. But my problem at the moment is that I can't find a way to query a user field if the app is not also integrated in the User_Sidebar. So is there a global way to query the user_fileds from the ticket_sidebar as well?
Currently I have a single function that I would like to move from user_sidebar.js to ticket_sidebar.js. But this is not possible for the mentioned reason.
Can someone help me with this?
Hi Wilhelm Lenz
Your function queries Zendesk API, and does not by itself rely on the context location. If what you need to acquire is the userId, then you need to define what the user role is within the ticket context. Assuming you are interested in the ticket requester's userId, you can try
Upon resolving the promise should return:
No I am not directly interested in the user ID but in the value in the user field, which I query with client.get. I unfortunately only found the connection with the requests and the get to access a user field. I can write to it with a setter on user.custom_field: from the ticket_sidebar directly. But I can't query this user field. I haven't found any other way to do that except from the user_sidebar. The user id is not important for me at this moment. I just want to be able to access and read the user field in the user_sidebar from the ticket_sidebar.
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.