Skip to main content

Description Format not maintained when creating ticket with API

  • February 7, 2019
  • 5 replies
  • 807 views


The formatting of the description seems to be strip by the API.  I am interested in maintaining line breaks, but those seem to be striped away.


I am using the code from the php example.

Did this topic help you find an answer to your question?
This topic has been closed for comments

5 replies

  • Contributor
  • 5 replies
  • May 13, 2019

I'm using Microsoft flow which is also using the API and it seems the "description" field is stripping my line formatting as well. Anyone have a fix/solution for this? 

image



First, it seems like this discussion is at least 4 months old - is there any input from Freshdesk support?


I'm having the same issue. When using the api, newline characters get stripped from the description with no effect on the resulting description. So, for instance,


this: "Here is a new\n\n description"

becomes: "Here is a new description"


and this: "Here is a new\\n\\n description"

becomes: "Here is a new\n\n description"


Please change the API so that newline characters actually have an effect on ticket description.


Just emailed Freshdesk support and got this response: 


"Instead of passing it in that format -- try passing it in the HTML format where instead of \n use -- <br> Something <br> and check if that's doing the trick."


Worked for me!


  • Contributor
  • 5 replies
  • May 30, 2019

Using <br> worked for me as well.


  • Apprentice
  • 2 replies
  • October 16, 2019

or better yet, wrap the description in <pre> .. </pre> tags then new-lines and indentations will be preserved.