Recent searches


No recent searches

Add Text Custom Field Value as a Tag?

Answered


Posted Oct 14, 2019

Hey!

    I'm currently on the professional plan, without the productivity pack included.  When I create a custom text field, I don't see a way to have the inputted value be added to the ticket as a tag without manually doing so which kind of defeats the intended purpose in my use case.  So in short, I'd like the following to occur:

1) Agent adds "LY005555" to custom text field

2) Upon submission, that field's contents gets added to the ticket tag section for reporting. 

Any thoughts on creative workarounds?  Thanks!


0

14

14 comments

Hello Josiah,

This can be done with a little workaround.

First you'll need to create a HTTP target (admin > settings > extensions):

The URL should be:

https://<subdomain>.zendesk.com/api/v2/tickets/{{ticket.id}}/tags.json

Replace <subdomain> with your subdomain. The username should be appended with '/token' and for the password provide an API key.

Now you'll have to create a trigger. Conditions will be somewhat like this ('Custom text' is my custom ticket field):

And the action something like this:

Make sure you replace the id with your custom field id.

{
"tags": ["{{ticket.ticket_field_<id>}}"]
}

With kind regards,

Sebastiaan
Sparkly ⭐

0


Thank you Sebastiaan!

    Your solution worked perfectly.  For anyone who is trying to solve the same problem, follow the tutorial above.  Cheers!

 

0


You're welcome!

0


So I've tried to set this up and it works for about a month, and then we get a message that there were too many failures and the extension was disabled. I thought maybe the trigger was firing too many times per ticket, so I set up the trigger using tags to only fire once per ticket. But when I made the update the extension disabled within an hour. 

Any ideas what may be causing it? Let me know if I need to provide any specific information.

0


Hello Sarah,

When you go to 'Channels > API' in the admin area there's a tab called 'target failures':

You can find more information about the failures there. Let me know what the status code and failure type is of your target if it doesn't make sense to you!

With kind regards,

Sebastiaan
Sparkly ⭐

0


Hi Sebastiaan, 

Thanks for pointing me in the direction of the error logs. I was getting a 422 error with the failure type "HTTP client call failed"

 

I clicked on one of the errors and saw the following under the Response section

{
  "error": "RecordInvalid",
  "description": "Record validation errors",
  "details": {
    "status": [
      {
        "description": "Status: closed prevents ticket update"
      }
    ]
  }
}

I took another look at my trigger and realized when I first set it up instead of using "Ticket is Updated" I used "Status has changed"

Am I correct that the issue was related to the trigger trying to update a closed ticket and failing?

 

 

0


Hello Sarah,

That's correct!

You could add a condition something like; 'status is less than closed' to prevent this.

With kind regards,

Sebastiaan
Sparkly ⭐

0


image avatar

Jimmy Rufo

Zendesk Luminary

Does anyone know if we can create a custom field in a ticket where an agent can add a pre-defined tag (that would pre-populate when typing), or add a new tag as necessary?  Seems this issue adds a new tag which is great, but I'd likely want to use it as well for staff to enter existing tags.

Basically, a replication of the "Tags" field, but renamed for specific tag utilization, and entry, and make it required to have a tag.

0


image avatar

Gail Leinweber

Zendesk Customer Care

Hi Jimmy,

A text field won't do what you're describing (text fields don't convert their values to tags), but if you only have a set number of tags that want for tickets and do want one one of them to be present on every ticket then a drop-down field might work for you. Drop-down field values all have tags associated with them, so you could make the drop-down field required to solve the ticket and then look for the tags associated with the field values.

If you start typing the name of the value you're looking for in a drop-down field, that does do a search of the values available so that would also help with auto-filling, but it won't allow for new values to be added in the field without an admin actually updating the field options.

0


image avatar

Jimmy Rufo

Zendesk Luminary

Hi @...,


Thanks for the feedback.  That's the crux of my issue, as being the admin in question, I don't want to have to continuously maintain this particular dropdown with new values to choose, and want the users to help maintain in this case.  The "Tags" field works in this fashion I believe, so I was hopeful we could do the same with a new field.

0


Hi!

I have requested help from ZD support with this case, but right now the HTTP target sections are obsolete. They tell me I have to set up a Webhook, but I don't know how to do it. I need the free text and numeric fields of the forms to be added as tags. Can someone help me with the steps to follow for this specific case? Thank you

0


image avatar

Brandon (729)

Zendesk LuminaryUser Group LeaderThe Humblident Award - 2021Community Moderator

Hello!

This process involves creating a Webhook in Zendesk and then using a Trigger to send data to that Webhook. Here's a step-by-step guide:

### Step 1: Creating a Webhook
1. **Go to Admin Center:** Access your Zendesk Admin Center. This is usually found at `[your-subdomain].zendesk.com/admin`.
2. **Navigate to Webhooks:** In the Admin Center, click on the **"Apps and Integrations"** icon (it looks like four small squares) and then select **"Webhooks"**.
3. **Create New Webhook:** Click on **"Add webhook"**.
4. **Configure Webhook:**
   - **Name:** Give your webhook a descriptive name.
   - **Endpoint URL:** This is the URL where the data will be sent. 
   - **Request Method:** Select **"POST"**.
   - **Request Format:** Choose **"JSON"**.
   - **Authentication.** This is your admin credentials to run the webhook


5. **Save Webhook:** Click on **"Create"** to save your webhook.

### Step 2: Setting up a Trigger to Use the Webhook
1. **Go to Triggers:** In the Zendesk Admin Center, go to **"Objects and rules"** > **"Business rules"** > **"Triggers"**.
2. **Add New Trigger:**
   - Click on **"Add trigger"**.
   - Name the trigger appropriately.
3. **Configure Trigger Conditions:**
   - Under **"Meet ALL of the following conditions"**, set conditions that must be met for the trigger to fire. For instance, you could use **"Ticket: Is...Updated"**.
   - Under **"Meet ANY of the following conditions"**, add any additional conditions if needed.
4. **Configure Trigger Actions:**
   - Choose **"Notify active webhook"** from the actions dropdown.
   - Select the webhook you created.
   - In the JSON body, you can map the free text and numeric fields to be sent as tags. For instance:
   
     {
       "tags": [
         "{{ticket.ticket_field_<field_id>}}",
         "{{ticket.ticket_field_<another_field_id>}}"
       ]
     }
     
     Replace `<field_id>` and `<another_field_id>` with the actual field IDs from your form.

5. **Save Trigger:** Click on **"Create"** to save your trigger.

If you need more detailed help or have specific questions about any of these steps, feel free to ask!

1


Thank you Brandon (729) This worked but I had one question for you. I noticed that when i set this trigger to fire based on the condition that the field in question was present it fired 33 times in a few seconds. Am I missing something to only make it fire once? 

0


image avatar

Brandon (729)

Zendesk LuminaryUser Group LeaderThe Humblident Award - 2021Community Moderator

Hey Chris Wisialowski

Adding an ALL condition for Ticket is Created or Ticket is Updated should solve for this.

Brandon

1


Please sign in to leave a comment.

Didn't find what you're looking for?

New post