Can not create a ticket with comments > html_body. The description field is required??? | Community
Skip to main content

Can not create a ticket with comments > html_body. The description field is required???

  • September 29, 2022
  • 2 replies
  • 0 views

I'm using the API to create a ticket, everything works fine, except I can not get HTML to work. The description value always overrides the comment, and the description.

And when description is not included I get this error:

{
'error':'RecordInvalid',
'description':'Record validation errors',
'details':
{'base':[{
'description':'Description: cannot be blank',
'error':'BlankValue',
'ticket_field_id':20690401,'ticket_field_type':'FieldDescription'}
]
}
}

I have comment included in the API call, but it does nothing (no error ,unless description is removed from the call)

"comment": {
    "html_body ": "<b>test</b>"
},

Which is weird, since the docs (https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#description-and-first-comment)  say to use comment vs description, but the validation seems to be making this impossible.

I checked in the admin, and Description is a standard field and I can not change the required property. What am I missing?

 

2 replies

  • Author
  • September 29, 2022

Hi Ahmed,

There was an error in my  original post... the problem is that without description included I get an error that that field is required.


  • Author
  • October 5, 2022

Your code worked... maybe I was using "body" and no "html_body".... hmmmm. Thanks Ahmed. You da man!!!!