This article discusses the impact of deleted values, such as a ticket field or tag, in your automations and how to correct the deleted values error.
This article contains the following sections:
About deleted values
When you create automations there are a variety of different conditions that you can select. See Automations conditions and actions reference. Some of these will always be present on your account, for example:
In Zendesk Support, tickets always have statuses, so there will always be a Closed status. While you can rely on statuses always existing, what about other elements, like Ticket Fields, which can be changed or deleted?
Deleted values in automations
Changing field values can have mixed results for your automations. If we create a condition that relies on a drop-down field called Test Dropdown with a value called pears, then change the name of that field value from pears to pears v2.0, the name in the automation condition will update.
However, on the back-end automations rely on tags for a lot of their functionality. So what happens if we go back to that pears field value and change the tag for that field value instead of its name?
If we change that tag to something else and then go back to look at our automation condition, we can see that it has broken that condition and now we are presented with an error "Value no longer exists. Choose another."
If instead of changing the tag, we just deleted the entire field value pears, we find that the exact same thing happens and we get the error in our automation condition stating "Value no longer exists. Choose another."
That error definitely doesn't look good, but what does it do?
The deleted values error message
Now that we've changed or deleted a ticket field value that an automation relied on and created an error in our condition, let's look at the rest of the automation to walk through what happened. Here's what the rest of our Automation looks like:
As you can see, the first condition displays the error message. The condition is then marked as erroneous and skipped.
Next, the automation looks to see if the ticket that this automation is checking is Less than Closed and Doesn't have the tag cricket.
Unfortunately, those remaining conditions match the rest of the active tickets in my account. So the cricket ticket tag gets added to all my tickets after this automation runs.
Solving the deleted values error
There are several different things you can do to solve the deleted values error:
- Update automations prior to changing ticket fields
- Reverse the automation to clean up tickets
- Make corrections using the Zendesk API
Update automations prior to changing ticket fields
The best solution to avoid running into this issue is to be aware of the conditions in your automations and adjust them before you make any changes to fields that they rely on.
You can change the field value that the conditions look for to a different field value, or you can disable the automation altogether because deleting the field makes the automation no longer relevant. Alternatively, you might adjust the automation to look for something completely different, so the condition matches the new situation that will be on the ticket going forward.
Whatever your decision, the main goal is to make sure that when you remove or change fields, it is not relied upon by any active automations on your account.
Reverse the automation to clean up tickets
To clean up tickets by reversing the automation:
- Create a new automation that undoes what the previous automation did.
- Create another automation that does what you originally intended.
In my example above, I accidentally added the tag cricket to all of my tickets. In my new automation, I added an action to remove all instances of the tag cricket. The automation would look like the image below:
This first new automation gets rid of the cricket tag. After this automation runs for a few hours to remove the tag from all of the tickets in my account, I need to create another new automation that puts the cricket ticket tag in place for the tickets I actually meant to have the tag. For example:
Now, I've successfully reversed the damage and corrected my tickets. The tickets I originally meant to have that tag will have it.
Make corrections using the Zendesk API
This solution is going to vary greatly, depending upon what scripting language you're comfortable with, any updates to the API, programming language updates, and evolving technology. These instructions will provide more of an outline, including links with more information about the Zendesk API.
To create a script to identify the affected tickets
- Retrieve the UNIX timestamp for when the automation started or the change was made to your field.
- Enter it in to the incremental events API endpoint to make a call to your account and obtain the ticket events that have taken place since that time.
If you don't have the exact date and time, look at your tickets for the time changes started to occur, look for when that field was last updated, or make a guess with a good time buffer to it.
- Once you pull those events, you can look for the Automation ID that did the unwanted action.
If you don't know the Automation ID, that should be listed in the List Automations endpoint. Then, pull ticket IDs from those events that contain the automation.
Once you have your affected tickets list, you'll need to determine the actions that need to be taken on those tickets to correct the issue and then loop through each affected ticket that you found to apply those updates. Using the Update Many Tickets endpoint will be the quickest way to achieve those bulk actions with a list of tickets.