1

I have a webhook which automatically opens tickets from our customer support software Freshdesk in Redmine. The description from the support software is sent containing plain HTML. When passing this to the Redmine API to create an issue, the description is created with the HTML and it is very difficult to read.

Example in request:

{
    "issue": 
    { "project_id": 62
    , "priority_id": 6
    , "tracker_id": 12
    , "status_id": 6
    , "assigned_to_id": 23
    , "subject": "Freshdesk - {{ticket.subject}}"
    , "description": "Product - {{ticket.portal_name}}\n\nDescription:\n<div>this is a div</div>\n\nLast Public Comment\n{{ticket.latest_public_comment}}\n\nLast Private Comment\n{{ticket.latest_private_comment}}\n\nAgent Email - {{ticket.agent.email}}\nFreshdesk URL - {{ticket.url}}"
    }
}

In Redmine:

  • Product - Product Name
  • Description: <div>this is a div</div>
  • Last Public Comment public comment
  • Last Private Comment Private comment
  • Agent Email - agentemail@ticket.com
  • Freshdesk URL - www.freshdesk.com
Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
L. Young
  • 163
  • 3
  • 7
  • 24
  • Example added. I'm expecting the
    tags to be read as html and not displayed as text.
    – L. Young Nov 14 '16 at 09:14
  • @GuidoLeenders any further help please? – L. Young Nov 16 '16 at 13:19
  • Looking at http://www.redmine.org/projects/redmine/wiki/Rest_Issues, why do you expect the
    tags to be read as html and not as text?
    – Guido Leenders Nov 17 '16 at 21:07
  • @GuidoLeenders I'm not expecting it but I would like to make it happen. I don't see the possibility in the api description so I am asking to see if there is some alternative solution to enforce the parsing of the html – L. Young Nov 29 '16 at 10:04

1 Answers1

0

Note: This issue is not linked to the Redmine API. You would have the same problem if you were to copy paste this directly into the issue description field.

What you want to achieve is not possible natively, as div tags are escaped.

You would need to change this line and add in the tags you want Redmine to keep:

ALLOWED_TAGS = %w(redpre pre code notextile div form input)

Be careful though, as this could mess up your layout and/or be potentially unsafe.

ste26054
  • 419
  • 3
  • 11