16

When editing a case via the main web interace you can hit a button that allows you to enter raw HTML (line breaks, <hr>'s etc...)

But HTML sent over the XML API (in the sEvent field) shows up in escaped form. Is there a way to call the API to tell it to interpret the sEvent literally?

Fog Creek Case FC2038784

flag

3 Answers

1

Currently, the XML API does not support inserting HTML into case events, however it does support reading HTML events.

If you'd like to see this functionality added to the XML API, vote up this question to show your support for this feature request.

link|flag
Thank you for the reply. It will save me beating my head against my importer script. Is there possibly some hackish way to accomplish the same thing? – Trey Stout Mar 7 2011 at 16:55
Currently, no...at least not via the XML API. :( With a plugin, you can set CBugEvent.sFormat to "html" and be all set. – db Mar 8 2011 at 15:00
Am looking to do this same thing, what's the pluging that allows you to insert html, I am assuming it doesn't work with the API – Jim May 16 2011 at 13:45
@Jim it's not an existing plugin, I was just saying that you could create a plugin that would allow you to create HTML bug events. Plugins use the Plugin API, which has different capabilities than the XML API. Basically, you'd have to retrieve the bug you wanted to modify, set bug.s to your HTML and bug.sFormat to 'html' and then commit the bug. – db May 16 2011 at 14:24
I am looking to do exactly this, the problem is I am an on demand customer and wanted to know if it is likely that you would approve a plugin that I wrote to do exactly what you describe able. – Simon parsons May 16 2011 at 17:40
show 1 more comment
0

I am an on demand customer and really could do with the ability to add HTML Events to existing cases. I have had a look at the plugin code and think it would be easy enough to create a secure externally available xml api that exposed feature but I was concerned that is I proceeded to write it you would either :

  1. Not approve the plugin for On-Demand use given that this is all it is likely to do

  2. Already be planning to release the ability in a future (and hopefully no too distant) release.

If you think it would be worth my while pursuing as a plugin then let me know and i will get to work.

Many Thanks

link|flag
0

This is such a huge frig I am almost embarrassed to put it up here, but here goes....

Basically we have a service running on the server that created a data feed for our customers, so we wanted to have the servers update the customers case with key information (like number of records etc) once the data feed has been prepared. What would have been nice is if we could have given the new events we were creating a different "look and feel" similar to the one that appears when you send and email. We therefore used the email markup as a template and used the XMLAPI to insert the events, but as the thread above describes adding HTML via the FB XML Api is currently unsupported.

To get around this I did the following:

  • Install the BugMonkey plugin
  • Then insert the following code into the javascript area of a a new customization:

var replace = document.querySelectorAll("div[id*='bugeventBody']");

for (var i = 0; i < replace.length; i++) {
   if (replace[i].innerHTML.match(/&lt;div[^<]*?class\s?=\s?(?:&quot;|\")[\s\w]*?decodeme[\s\w]*?(?:&quot|\")/gism)) {
      var decoded = $("").html(replace[i].innerHTML).text();
      replace[i].innerHTML = decoded;
   }
}

This works by using javascript to locate any event that you have added via the XMLAPI that is contained within a parent tag that has the class "decodeme" i.e.



<div id="someid" class="decodeme email">
......
</div>

Once located the javascript then proceeds to decode and the text contained within the event body.

Fingers crossed the FC boys come up with a more elegant solution soon!

Simon Parsons MarabouStork ltd

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.