2

I using node-zendesk package to create ticket on zendesk platform. It has created the ticket successfully on the zendesk platfrom. But unable to send the html content through below code. So how to pass the html content on the zendesk api.

var ticket = {
    "ticket":
      {
        "subject":subject,
        "comment": {
          "body": "<p>Hello</p>"
        }
      }
    };
  client.tickets.create(ticket, (err, req, result)=> {
    if (err) {
      console.log('client.tickets.create-err', err);
      return;
    }
  })

2 Answers2

1

If you want to pass HTML into the ticket body don't use "body" instead use "html_body", then your HTML will be parsed like this:

"ticket":
  {
    "subject":subject,
    "comment": {
      "html_body": "<p>Hello</p>"
    }
  }
Jason Diehl
  • 191
  • 1
  • 9
0

i had the same issue, you can use markdown syntax to do different stuff for example text(one * before and after text) text (two * before and after text) text (three * before and after text).

Or to do different stuff try to edit the text using markdown before assign it to body.

Adrian97gl
  • 26
  • 2