Format calculated text fields

Wouter Franssens May 26, 2014

Hello,

I have a calculated text field that is primarily used when a filter is exported from Jira to Excel for offline usage.

I have used "s.append ("< strong>")" and "s.append ("< /strong>")" and also tried it with "s.append ("< b")" and "s.append ("< /b>")". Both options do turn that portion of my calculated text bold in my webbrowser, but when I export it to Excel, it shows the tags as text.

what should I do in order to show this bold in the exported Excel?

Thank you,

Wouter

2 answers

1 accepted

0 votes
Answer accepted
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2014

Unfortunately, Excel imports CSV as text only. To my knowledge, you cannot forward any formatting on to Excel this way.

Wouter Franssens May 26, 2014

Hello David,

Thanks for your quick reply.

Agreed, but the JIRA export is in the .xls format. When I open this file in for instance Notepad++ and edit the content with < strong> and < /strong>, it does show correct in Excel. So for some reason, JIRA is not including the format in the export it creates. It does however include formatting in other cells, like the headers.

I find it strange, since "\n" for a line break does work in the XLS export, but is not shown in JIRA.

Wouter

David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2014

I'm not sure I understand. After exporting to Excel, did you try opening the resulting file in Notepad++? What is it showing where <strong> should be? Initially, you said the tag is shown as text in Excel, and then you said the tags are removed from the XLS export?

Wouter Franssens May 26, 2014

Let me clarify: your questions are pushing me in the right direction I think :-) :

  • In the edit section of my custom field:
    • s.append("< strong>")
    • s.append("test")
    • s.append("< /strong>")
  • In the jira issue overview:
    • test
  • In Notepad++: &lt;strong&gt;test&lt;/strong&gt;
  • In Excel: < strong>test</ strong)

The text that is exported in bold to Excel by default (for instance in the header: "Displaying x issues...":

  • In Notepad++: <strong>test</strong>
  • In Excel: test

So: if we can get "<" into the export instead of "&lt;", I think it should work.

(I only added the spaces here for visibility)

David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2014

The thing is, this is the standard behavior of the Excel export in JIRA. JIRA escapes all HTML tags for security reasons.

You will need to unescape the tags as a post-process on the exported file, before you feed it into Excel.

0 votes
Wouter Franssens May 26, 2014

Ok, that's unfortunate :-).

Thanks for your time to look into this.

Wouter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events