Vor Kurzem aufgerufene Suchen


Keine vor kurzem aufgerufene Suchen

webhooks for mapping customer orgenization field to customer ticket field



Gepostet 17. Mai 2022

Hello Team,

I need your help where I want to map the customer organization Field to the Custom ticket field. I am using the webhook PUT   https://dmydomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json and following JSON scrip. i am getting the 200 responses the custom ticket field is not getting updated. 

 

{
  "ticket": {
    "custom_fields": [
            {
                "id":     5992342402971,
                "value": "{{ticket.organization.custom_fields.30000001.title}}"
                }
                ]
                }
}

Can you please help me with this request?

 

Thank you,

Abhishek Govani


0

3

3 Kommentare

Hello Ahmed Z,

Thank you for your quick response. I am using postman to make these calls. Below is the cURL I am using. 

The customer field ID is 6008820290459, the Organization customer field name is "copilotid" and the id is 6008825162139. Both customer fields are numeric.

--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWJoaXNoZWtnb3ZhbmkyN0BnbWFpbC5jb206QWJoaXZpc2gwMjE3QA==' \
--header 'Cookie: __cfruid=cb748e0da69b71d25e223aee772a50b58aa84272-1652810031; _zendesk_cookie=BAhJIhl7ImRldmljZV90b2tlbnMiOnt9fQY6BkVU--459ed01949a36415c1716b5711271c3d08918307' \
--data-raw '{
  "ticket": {
    "custom_fields": [
            {
                "id": 6008820290459,
                "value": "{{ticket.organization.custom_fields.copilotid}}"
                }
                ]
                }
}'
 
Below is the image that shows the response as well as the API call that I made from the postman.
 
 
Organization custom field
 
ticket custom field 
 
Test organization
 
 
Ticket
 
Thank you,
Abhishek Govani
 

0


Hello Ahmed Z,

Thank you for the update. I suspected that it will require me to create three different triggers(better than creating it for all the organizations) but the JSON is not working as expected for me. Looks like the API call is taking {{ticket.organization.custom_fields.300001}} as a value and not as a placeholder thus giving me 422 error(because the "id": 456123457 fields is configured to be numeric and the value passed contains characters). If you can help me get the below JSON to work, I am ok with creating multiple triggers. 

{
  "ticket": {
    "custom_fields": [
        {
          "id": 456123457,
          "value": {{ticket.organization.custom_fields.300001}}
        }
        ]
    }
}

Thank you,

Abhishek Govani

0


Hello Ahmed Z,

Appreciate your response. I will certainly check it out. I also have one complex requirement

The organization has multiple custom fields such as 300001(numerical), 300002(numerical), 300003(numerical). 

The customer filed present on the Agent workspace is only one. Based on the customer field "location" the customer will select the respective organization field that should be populate in the customer field. 

 

For example,

Organization 1 has these three fields. PROD[300001(numerical)]=123456789, UAT[300002(numerical)]=987654321, and Sandbox[300003(numerical)]=5647889123. 

The customer field on the agent dashboard is accountID[456123457(numerical))

Location(dropdown): PROD, UAT, Sandbox

if customers select prod in location, accountID[456123457(numerical))= 123456789 should be shown on the ticket. 

 

I hope this make sense. Please let me know if you need more information. 

 

Thank you,

Abhishek Govani

0


Anmelden, um einen Kommentar zu hinterlassen.

Sie finden nicht, wonach Sie suchen?

Neuer Post