Webhook - Copy a field on the same ticket | Community
Skip to main content

Webhook - Copy a field on the same ticket

  • March 22, 2022
  • 1 reply
  • 0 views

James36

Hi, 

I hope you can help. 

We have a ticket field that populates upcoming event names for end users to search. However, the values get overwritten once the event has passed. So I would like to know how I can create a webhook that will copy the value of field A into field B as text field on the same ticket.   

1 reply

Dane13
  • April 28, 2022

Hi @james36,

You can use the endpoint below to create a webhook.

https://YOURSUBDOMAIN.zendesk.com/api/v2/tickets/{{ticket.id}}.json

Make sure to select PUT as your Request Method.

Once done, you'll need to create a trigger that utilizes custom field placeholders as your payload.

{
  "ticket": {
    "custom_fields": [
            {
                "id": <Field B ID>,
                "value": "{{ticket.ticket_field_<Field A ID>}}
            }
            ]
    }
}

Here is an example of a simple trigger.