Validation error when setting custom field | The place for Zendesk users to come together and share
Skip to main content
Mark32
December 6, 2024
Question

Validation error when setting custom field

  • December 6, 2024
  • 12 replies
  • 68 views

I'm trying to update a custom field value via the API. I'm using a PUT request to /api/v2/tickets/<ticketID>.json I'm getting a validation error as follows:

{
  "error": "RecordInvalid",
  "description": "Record validation errors",
  "details": {
    "base": [
      {
        "description": "Incident vs. Service Request: needed",
        "error": null,
        "ticket_field_id": 21621964218653,
        "ticket_field_type": "FieldTagger"
      }
    ]
  }
}

 

The “Incident vs. Service Request” field is not the field I'm updating. I assume there some is configuration that is making this field required when updating a ticket, although I can't figure out what that config might be? The field has “Required to solve a ticket” enabled, but I'm not trying to solve a ticket, and there are other fields with this setting which don't cause the same problem. Can anyone help me out?

 

Thanks.

 

12 replies

Amie11
Newcomer
December 9, 2024

If you're trying to update a value inside a drop-down field that is utilised inside ticket field conditionality then you would run into this error. You ideally need to remove the field from the conditional logic config, update the field, then add the field back into the logic

Amie Brennan
James57
December 17, 2024

@mark32 - were you able to figure this out?  We've had the same problem and solved just like Amie mentioned.  Otherwise would be curious what is the problem you have run into.

Mark32
Mark32Author
March 4, 2025

@james57 no I haven't been able to resolve it. I'm not updating a drop-down field. Just a custom field with a free text value. The custom field needs to be updated as soon as the ticket is opened, but I can't update it due to this validation error message. The field is only conditional on the ticket being submitted, but I'm not trying to submit the ticket, merely update a custom field. 

James57
April 12, 2025

Hi Mark,

Thank you for the additional information.  It's a bit hard to know what the issue might be without seeing the entire request and knowing the set up in the account, but maybe we can still help.  Are you able to share across the API request you are making?  Also, do you have other requests set up that are working?

Newcomer
June 17, 2025

Hi @mark32 , we're facing exact same issue as you. Were you able to solve the issue ?

Erica
Employee
June 24, 2025
Hello Hrishikesh, 
 
Typically when we see a validation error like this, it's due to the custom ticket field being tied as a condition for another ticket field. An example would be if ticket field ABC includes "specific text" then ticket field XYZ must have a specific value. This would mean that when you submit a request to Update the ticket field ABC you must also update XYZ since it is conditional upon that. 
 
I would recommend looking over your ticket field conditions to see if that could be the case. 
 
If you determine that there are no conditional conflicts definitely let us know and we can take a closer look for you.
Mark32
Mark32Author
June 25, 2025

@erica26  this is not what is happening. There is a field that is required for submitting a ticket. However I am trying to update a completely unrelated field and I am not trying to submit the ticket. It seems that you can not make any updates to any custom fields on a ticket whilst there are other required fields that are not completed.  This seems like a bug to me.

 

@hrishikesh11  I have found very roundabout way to solve the issue. My API request is coming from a sidebar app. There is a ‘ticket.submit.done' event that is fired when the ticket is submitted. At this point we know that all required fields must have been completed, so we can then update any custom fields by listening to this event. When I tried this initially it did work, however if the agent has the option selected to close the ticket on submit, the ticket is closed before the field can be updated, so the update never completes. This seems like another bug to me - but I found a horribly complicated work around. I created a secondary app running in th “background” location. This app runs constantly, even when I ticket is closed. So now my sidebar app still listens to the ticket.submit.done event, but instead of updating the custom field directly, it triggers another event in the background app with the required data. The background app then updates the custom field and will still work even if the ticket closes before the update has happened.

Erica
Employee
June 27, 2025
Unfortunately, if there are any other unpopulated required fields when making a ticket update those would have to be included. 
 
However, you shouldn't need to utilize additional apps to ensure this field gets populated. You would just need to add a trigger which would make this field conditional and would prevent the ticket from closing without. 
 
I've attached a screen recording to demonstrate what it looks like to the agent with this trigger in place. Even if all of the other required fields are populated the agent can not set the status to solved until that specific field is populated.
 
For the trigger you would just set your conditions to if that ticket field value is missing and the ticket status is changed -> then the action would be to set the status to open. 
 
This will alert the agent of the error and force the ticket status to stay open until the field is completed the field.
 
Mark32
Mark32Author
June 27, 2025

@erica26  thanks for your reply. I don't see a screen recording though?

Erica
Employee
July 1, 2025
Hmm that's strange. I'm going to attach it again but in case you're having issues opening it, I will also share this google drive link which you can also use to access it.