We have a Jira Service Management project that often has tables pasted into a text field.
When using that field in an email action in A4J, the table appears like the confluence wiki mark-up for a table, e.g.
|| heading || heading ||
| text | text |
| text | text |
What I'm hoping to do in A4J is parse that into HTML so the table appears correctly in the email that A4J sends.
Can any one suggest a way?
So, turns out there's a .html option, but depending on what's in the table in the field can produce some ugly results with badly aligned text.
Field output from {{customfield_10347}}
Output from {{customfield_10347.html}} which the forum won't let me include, looks very vanilla and should just produce a very plain table. Sadly, it doesn't.
Which sadly appears in Outlook like this, which seems to be extra line feed chars added as part of the .html option for each pipe char in the original mark-up that displays a table in Jira/Confluence.:
By adding in the .replaceAll I was able to remove the unwanted new lines, and then use a few .replace to change the styling to something more like I wanted
{{customfield_10347.html.replaceAll("(\n)","").replace("'table-wrap'>","'table-wrap' style='font-family: calibri, arial, sans-serif; font-size: 11px; border-collapse: collapse; text-align: left; vertical-align: top;'>").replace("'confluenceTh'>","'confluenceTh' style='color: #fff; background: #204b87; padding: 5px; height=15;'>").replace("'confluenceTd'>","'confluenceTd' style='color: #fff; background: #204b87; padding: 5px; height=15;'>")}}
Wow. Took me a year of distractions to finally get enough time to sort out my own problem. I hope that helps someone one day
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.