Updating Organization with client.set from ticket sidebar (ZAF) | Community
Skip to main content

Updating Organization with client.set from ticket sidebar (ZAF)

  • November 14, 2022
  • 3 replies
  • 0 views

Tatsuya12

Hi, is there a way to update the organization dropdown value from a ticket sidebar app?

In the documentation (https://developer.zendesk.com/api-reference/apps/apps-support-api/ticket_sidebar/#ticketorganization) I can see that there's no client.set for the organization field.

Thanks

3 replies

Greg29
  • November 14, 2022

Hi Tatsuya! While we don't have a specific client.set method available for it, you can just make an API request to the update the ticket with the new organization_id, using client.request. If you first need to know the available organizations for that user, you can access the ticket.requester object in the ticket sidebar location and return the user's orgs with this: `client.get('ticket.requester.organizations'`


Erick14
  • April 30, 2024

I attempted to implement the solution using the "ticket.submit.done" event. However, when attempting to retrieve the ID using CLIENT.get('ticket.id'), the ID was not returned. I would appreciate any guidance on whether the chosen ticket event is appropriate for this purpose.


Tipene
  • May 2, 2024

Hey Erick,

Can you let me know the location that your app is running? The ticket.id property is the correct property as mentioned in the docs here, though depending on location, your app might not have access to the ticket object.