Format calculated text fields

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

Accepted Answer
0 votes

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

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

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?

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)

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.

Ok, that's unfortunate :-).

Thanks for your time to look into this.

Wouter

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Thursday in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

456 views 3 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you