Jira Forms - Unable to get formatted data. (Easily)

Monty
Contributor
February 25, 2025

I'm having a few issues with Jira Forms, but it mainly results in not being able to get the form data in a presentable format.  This is going to be a long post because of the examples and screenshots. but I'll summarize quickly:

  1. PDF Output does not respect words when wrapping and does not create Hyperlinks for links
  2. XLSX Export does not include formatting, or link URL.
  3. API content is the same as XLSX cell, except it also has issues with quotation marks.
    1. I reviewed the API again and it does appear that I can get the form answers as an ADF document. Not as easy to work with as Markdown, but it's something at least.
  4. There does not appear to be a way to get all of the data submitted in a form that includes all of the data and formatting. It is obviously saved since it can display the form content within Jira, but there is no method for exporting all of the form information. If the XLSX or API used Markdown, it'd be fine.

 

Example Text

First, the example text.  Notice that when presented in the interface, this information respects words when wrapping and includes all formatting. The form has one Paragraph form field and I've added the following example text:


 

Heading 1

Lorem ipsum dolor sit amet, BOLD TEXT: consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. ITALIC TEXT: Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. STRIKETHROUGH TEXT Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.

Heading 2

Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum.

Bullet List

  • Item 1

  • Item 2

  • Item 3

Numbered List

  1. Item 1

  2. Item 2

  3. Item 3

Link to Example Site


PDF Export Screenshot

Now, here is a screenshot of that form's PDF export:

Form Test - PDF.png

PDF Results

Ok, so the PDF formatting is terrible and for the link, useless because it doesn't actually create a hyperlink or show the URL.  The next thing I tried was the XLSX export thinking that it'd have the data in some format like Markdown.

Note: This isn't included in this example, but another quirk I found while testing is that attachments on a form are displayed as a UUID string with no filename, link, or context.

XLSX Export Screenshot

Form Test - XLSX.png

XLSX Results

This was even worse. Not only did it not show the URL for the link, but it also did not present any of the formatting. I realize that adding text formatting to cell is likely pretty complicated, but if this were at least in Markdown I could copy and paste it into a Markdown view and get the formatted data.  With the XLSX, any formatting other than lists is completely lost.

 

API

Ok, so if the PDF and XLSX are unusable, surely there is an API that I can use to get all of the information and then I can do whatever I want with it right?  Wrong.

 

https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-issue/#api-group-forms-on-issue

My options for getting the form data are either:

Final Results

The only method for getting the complete form data is via the Get Form API and this includes the data in the Atlassian Document Format which is cumbersome because there are no built-in parsers for it and Atlassian doesn't provide an API for converting ADF to HTML or Markdown.

1 answer

1 vote
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2025

Hey @Monty - I came here from your comment on JRACLOUD-77436. I wonder if you happened to see my comment from the end of December.

I don't know if you have a Confluence site handy (but it might be worth spinning up a free one for this), but Confluence has conversion endpoint: Asynchronously convert content body

It supports these conversions:

  • atlas_doc_format: editor, export_view, storage, styled_view, view
  • storage: atlas_doc_format, editor, export_view, styled_view, view
  • editor: storage

I fed it the ADF of one of my Jira comments that included a table with a merged cell, requested styled_view, and got back very nice HTML, with the merged cell intact.

So if you are going to the trouble of grabbing ADF, this endpoint might give you a way to then convert it into HTML.

Monty
Contributor
February 26, 2025

My company has some ancient stigma around using Confluence so it's a non-starter, but I may test this with my own sandbox instance. Thanks for reaching out - this is the sort of thing I've been looking for!

Monty
Contributor
February 26, 2025

Hmmm.. I am having a bit of trouble with getting this to work.

The example they use is:

curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/contentbody/convert/async/{to}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "value": "<string>", "representation": "view" }'


Request

Path parameters

to

string
Required

The name of the target format for the content body.

Valid values: export_view

So even if I'm using `styled_view` for the representation string in the body, the URL is still:

https://your-domain.atlassian.net/wiki/rest/api/contentbody/convert/async/export_view

Is that right?

 

Request bodyapplication/json

The content body to convert.

value

string
Required

The body of the content in the relevant format.

representation

string
Required

The content format type. Set the value of this property to the name of the format being used, e.g. 'storage'.

Valid values: view, export_view, styled_view, storage, editor, editor2, anonymous_export_view, wiki, atlas_doc_format, plain, raw .


So my body looks like this:

{
"representation": "styled_view",
"value": "{ \"version\": 1, \"type\": \"doc\", \"content\": [ { \"type\": \"heading\", \"attrs\": { \"level\": 1 }, \"content\": [ { \"type\": \"text\", \"text\": \"Heading 1\" } ] }, {
\"type\": \"paragraph\", \"content\": [ { \"type\": \"text\", \"text\": \"Lorem ipsum dolor sit amet, BOLD TEXT: \"
...
...
}

 

But I'm getting: The remote server returned an error: (400) Bad Request.

I tried giving adding the ADF document to the value parameter as JSON, but it didn't like that either.

I passed the ADF to the https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/ to validate it and it looks fine.  Not sure exactly what I'm doing wrong.

Monty
Contributor
February 26, 2025

Here is a link to the ADF document:

https://pastecode.io/s/es30o5zf

Here is my Body JSON with the value parameter as a string:

https://pastecode.io/s/24836dks

Monty
Contributor
February 26, 2025

AHA! Never mind, I figured it out after reading https://developer.atlassian.com/platform/forge/using-rich-text-bodied-macros/

 

The API documentation confused me because it said the only valid value of the {to} parameter was 'export_view' so I assumed that was the only value. Then for representation, I thought this was how to select what format you wanted returned, not the type of document that you are sending to the API.

Once I reversed those, it worked great.  THANK YOU!

Now, if only they could add this (or similar) endpoint to the Jira Cloud Platform API or provide it's own separate documentation like they did with the Jira Forms API, it'd be more universally available for folks without relying on Confluence.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events